By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

Displaying search results in a list box

P: 14
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.RowSource 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,FirstName,PhoneNumber,Email FROM tbl_PersonalInfo WHERE " & Forms!DisplayForm1!SearchBy.Value & " LIKE " & Criteria2

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

Jan 16 '09 #1
Share this Question
Share on Google+
1 Reply

P: 14

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 ' * '
Jan 16 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.