Results 1 to 4 of 4
  1. #1
    LornaM is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    15

    Synchronize a combo box with text in a textbox on a form

    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

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Me.RecordsetClone.FindFirst "[strUserID] = '" & Me![cmboFindUser] & "'"

  3. #3
    LornaM is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    15
    How silly of me....but I guess that's what happens when a person works until 3:00 in the morning...they lose their ability to reason! Thanks so much for your expert help; that fixed the problem.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    Great! Glad I could help. Been there, done that.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 02-24-2009, 12:37 PM
  2. Keeping text in a report textbox
    By Hawkx1 in forum Reports
    Replies: 2
    Last Post: 11-13-2008, 04:11 PM
  3. Write text to text box on a form
    By DKY in forum Programming
    Replies: 0
    Last Post: 10-08-2008, 11:34 AM
  4. Replies: 0
    Last Post: 08-17-2008, 12:19 PM
  5. Replies: 1
    Last Post: 08-10-2008, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums