Results 1 to 2 of 2
  1. #1
    IshBuild is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    1

    Use a combo Box to pull up a record.

    Hi all,

    Hoping someone might be able to help.

    I'm trying to use VBA to pull up a record by selecting it via a combo box.

    I know you can do it with Macros but I need to add extra VBA commands and Macros don't have the versatility in my eyes. I've tried using this code below but I'm not having much luck.

    Code:
    Private Sub Cbo_SelectExistingCategory_AfterUpdate()
    
    
     ' Find the record that matches the control.
        Dim rs As Object
    
    
        Set rs = Me.RecordsetClone
        rs.FindFirst "[Category_ID] = " & Str(Nz(Me![Cbo_SelectExistingCategory], 0))
        
    
    
    End Sub
    Thanks in advance!

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This is the code:
    Me.Filter="Category_ID=" & Me!Cbo_SelectExistingCategory
    Me.FilterOn=True
    Me.Requery

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

Similar Threads

  1. Combo Box A OR Combo Box B to pull up a record
    By darth.pathos in forum Forms
    Replies: 3
    Last Post: 06-06-2013, 01:31 PM
  2. Replies: 2
    Last Post: 05-08-2013, 03:37 AM
  3. Combo box to pull from active directory
    By JackieEVSC in forum Forms
    Replies: 2
    Last Post: 12-06-2011, 08:39 AM
  4. Width of combo box pull-down
    By VirgilMachine in forum Forms
    Replies: 3
    Last Post: 11-19-2011, 10:34 AM
  5. Replies: 0
    Last Post: 12-19-2006, 09:44 PM

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