Displaying search results in a list box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buddydasari
    New Member
    • Mar 2007
    • 14

    Displaying search results in a list box

    Hi All

    I am new to VBA also have little knowledge of access.I am trying to write a search app. which searches the table based on some criteria(combo boxes) and displays the results in a list box(everything in a single form).I wrote the event procedure for this and set the listbox.RowSour ce to the query(its a dynamic query build from the search criteria)

    I know the query works cause i've tested that but i cannot figure out why the list box isn't populated and also when i check the properties of list box it doesn't show the query in RowSource property.

    Here is the line of code to set rowsource

    Me.ResultsList. RowSource = "SELECT LastName,FirstN ame,PhoneNumber ,Email FROM tbl_PersonalInf o WHERE " & Forms!DisplayFo rm1!SearchBy.Va lue & " LIKE " & Criteria2

    Am i doing anything wrong?
    Or do i need to add anything?I have no clue where/what i am doing wrong.

    thanks
    Sree
  • buddydasari
    New Member
    • Mar 2007
    • 14

    #2
    oops

    got it working.its the ' * ' thing instead of ' % ' in Like operator.
    God this took me 4 hrs..cause one version with ADODB record set works with ' % ' and basic vba works with ' * '

    Comment

    Working...