Results 1 to 2 of 2
  1. #1
    Krs13 is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Posts
    5

    Filter subform based on combobox on main form

    I need to filter the subform based on the combobox(Unbound) in the main form. After filtering i need to add some values. Below is the code i put in after update of combobox but i get error 424.



    Client_info is table name
    id is field name
    cboid is combobox name in mainform
    client_info_sub is subform name

    Private Sub cboid_AfterUpdate()
    Dim LSQL As String

    LSQL = "select * from Client_Info"
    LSQL = LSQL & " where ID = '" & cboId & "'"

    Form_Client_Info_sub.RecordSource = LSQL
    End sub

    Can anybody help on this pls.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What is error 424? If the ID field is numeric, try

    LSQL = LSQL & " where ID = " & cboId
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  3. Replies: 1
    Last Post: 06-14-2010, 02:31 AM
  4. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  5. Replies: 7
    Last Post: 05-24-2009, 10:24 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