Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Listbox question

Listbox question

Listbox question

Hello Everyone!

I was hoping that someone might have the answer to a question.  I have a search form with a listbox, a text field, a combo box and a button.  Usage:  
1.  Select a value in the combo box, e.g. First Name, Last Name, ID.  

2.  Next, there is a text box to enter the search criteria, "Smith" let's say for last name.  

3.  Next, click the find button.  

The purpose here it for the appropriate row of the listbox to be selected based on the criteria and combobox selection.  For example, if the user chooses Last Name, then enters "Smith"  the first occurrence of "Smith" as the last name in the lisbox should be selected.

I am lost...brain cramp...HELP!

Thanks in advance,


RE: Listbox question

Hey there if you set the button to
on click

Then in the List properties click on the row source field so that it goes into SQL. Looks the same as creating a query.
Presuming that you have 3 different combo boxes one for Title, FIrst name , last name. You need to assign the fields to their corresponding combo boxes. In criteria enter
IIF(ISNull([Forms]![form name]![combo box name]),[field name],[Forms]![form name![combo box name])
This will set the list box to show all the not null records in the list box enless you specify which ones you want to change it to.
This will work with combo boxes but when you get into list boxes thing become a little bit more tricky. There you have to use a like statement.
Have actually been designing something similar for a bussiness in the city if you want a copy of the form then I can send it you. Only thing is that it will not have the table but you can use it for referecne. Or you can go to the Microsoft site (support.microsoft.com) and run a search in Access for Criteria.
See ya

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close