Results 1 to 5 of 5
  1. #1
    gango is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2023
    Posts
    3

    combo box serach as you type

    hi,
    I am using this vba in my combo box in subform, but when i go to next record and select another "productnr" that is defferent then then the above selected in the above record "productnr" disappear
    Private Sub productid_Change()
    Dim strSQL As String
    If Len(Me.productid.Text) > 0 Then
    strSQL = "SELECT product.id, product.productnr, product.cod FROM product WHERE (((product.productnr,) Like '*" & Me.productid.Text & "*')) ORDER BY product.productnr,;"
    Else


    strSQL = "SELECT product.id, product.productnr, product.cod FROM product ORDER BY product.productnr; " 'This is the default row source of combo box
    End If


    Me.productid.RowSource = strSQL
    Me.productid.Dropdown
    End Sub

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430

  3. #3
    gango is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2023
    Posts
    3
    ok,thanks! i used the code of your example. it is perfect, but i have some vba calculation in combo before update event which are connected with column (0) and with them code does not work

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    without knowing what that means, can't really provide any advice other than perhaps look at using different code or a different event

  5. #5
    gango is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2023
    Posts
    3
    Thanks again, it was my wrong, everything is ok.

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

Similar Threads

  1. Search as you type in Combo Box
    By Grandad in forum Access
    Replies: 29
    Last Post: 07-11-2020, 12:31 PM
  2. Type Mismatch in Combo Box
    By uaguy3005 in forum Forms
    Replies: 6
    Last Post: 12-04-2015, 03:15 PM
  3. Replies: 5
    Last Post: 07-28-2014, 04:05 PM
  4. search as you type in combo box
    By pratim09 in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 07:46 AM
  5. Replies: 0
    Last Post: 02-27-2009, 01:27 PM

Tags for this Thread

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