I'm using Access 2003 and Windows XP.
I have a form which I use for entering new users. On it I have a combo box which I want to use for quickly finding and editing other users records contained in the form's recordset. I have used this procedure successfully on other forms without any problem, but for some reason I keep getting a runtime error every time I try to use the combo box to find a user. For example, if I try to find a user contained in the recordset for the form whose userID is "royboy", I get the following runtime error:
Runtime Error '3070':
The Microsoft Jet database engine does not recognize "royboy" as a valid field name or expression.
Following is the code I have attached to the AfterUpdate event for the combo box.
Code:
Private Sub cmboFindUser_AfterUpdate()
' Find the record that matches the selection in the combo box.
Me.RecordsetClone.FindFirst "[strUserID] = " & Me![cmboFindUser]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
On another form where I have done something similar with a combo box, the field I was sychronizing with was a number field and it worked perfectly. As you can see, the strUserId field on this form is a text field. Is that the problem why it's not working? If so, how do I work around it? Any help would be appreciated.
Thanks