Hi,
I have a form where data is entered for a new client onto DBGrid (using Unbound mode with associated coding from the help). There could be any number of entries on the screen, so I’ve created the grid with 13 blank rows to start off with, which I increment if necessary.
My big problem is that if a user clicks on the blank part of the grid, I get the error “6148 Invalid Row Number”, in the UnboundWriteData for the grid. If I try to trap that error, and bypass the code, I get other errors firther on. I cannot find anything which stops this error, or which bypasses it. I’ve been told to solve this quickly- any ideas please?
Private Sub gridSubject_UnboundWriteData( _ ByVal RowBuf As TrueDBGrid50.RowBuffer, WriteLocation As Variant) ' The UnboundWriteData event is fired when the user ' modifies an existing row within an unbound grid and ' attempts to commit the changes by moving to another ' row or calling the Update method of the grid. Dim I As Integer For I = 0 To RowBuf.ColumnCount - 1 If Not IsNull(RowBuf.Value(0, I)) Then If Not StoreUserData(WriteLocation, I, RowBuf.Value(0, I)) Then RowBuf.RowCount = 0 Exit Sub End If End If Next I End Sub