I have a database of about 10 tables, 300 records. ProjectName is the primary field.
There's a (single view) form that shows the data; it contains a lookup combo box to take the viewer directly to that item in the form.
In the combo box, there's this AfterUpdate event procedure:
Private Sub cmboLookup_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ProjectName] = '" & Me![cmboLookup] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
The data entry person reported that three of the records she has added cause an error in the lookup field (run-time error 3077). All others work correctly. On debug, this line is highlighted:
rs.FindFirst "[ProjectName] = '" & Me![cmboLookup] & "'"
The names in the lookup table use the supporting table as source, so there's no discrepancy in ProjectName. I don't see what's different about the three entries that provoke the error. Any help would be appreciated.
S. Nicholls
There's a (single view) form that shows the data; it contains a lookup combo box to take the viewer directly to that item in the form.
In the combo box, there's this AfterUpdate event procedure:
Private Sub cmboLookup_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ProjectName] = '" & Me![cmboLookup] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
The data entry person reported that three of the records she has added cause an error in the lookup field (run-time error 3077). All others work correctly. On debug, this line is highlighted:
rs.FindFirst "[ProjectName] = '" & Me![cmboLookup] & "'"
The names in the lookup table use the supporting table as source, so there's no discrepancy in ProjectName. I don't see what's different about the three entries that provoke the error. Any help would be appreciated.
S. Nicholls