I have a simple combobox that is used to find and bookmark a matching record on a form. I just used to the wizard to create it since it's easy and it works. The code is:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[EntityID] = " & Str(Nz(Me![cmbSearchbyEntity], 5))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
My problem is that some of the items in the combobox do not have matching records in the table that the form is bound to. If there is no corresponding record for the selection the user makes in the combobox, I want to have a msgbox appear telling them so. Given the above code, I can't figure how to do it. Does anyone have a suggestion? Also, I don't understand why the If Not...Then statement in the code doesn't require an End If???
Thanks in advance! lastout (the game's not over till it's over)
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[EntityID] = " & Str(Nz(Me![cmbSearchbyEntity], 5))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
My problem is that some of the items in the combobox do not have matching records in the table that the form is bound to. If there is no corresponding record for the selection the user makes in the combobox, I want to have a msgbox appear telling them so. Given the above code, I can't figure how to do it. Does anyone have a suggestion? Also, I don't understand why the If Not...Then statement in the code doesn't require an End If???
Thanks in advance! lastout (the game's not over till it's over)