how to display records on a form based on a listbox

illusionek

Registered User.
Local time
Today, 08:25
Joined
Dec 31, 2013
Messages
92
Hello,

I designed a simple form that has a listbox and a subform. I am using Northwind database for testing.

I would like to be able to display on a subform only records based on a value of a list box.

I created a listbox using a wizard and selected an option 'find a record on my form based on the value I selected in my list box'. This kind of works but it does not display all records matching criteria.

Attached print screen 1 shows my table and there are six records for 'Las Vegas' but my sub-form displays only three for Karen Toh (print screen 2) and all records for John Edwards are missing. I am not really sure how to fix this problem.

Ideally I would like to take this a step further and do another list box with Last Name and then filter data even further down so for example if I select Last Vegas and Edwards then the form would show me only matching records.


I will be very grateful for any suggestions :D
 

Attachments

  • print screen 1.JPG
    print screen 1.JPG
    52.8 KB · Views: 109
  • print screen 2.JPG
    print screen 2.JPG
    27.4 KB · Views: 94
Make sure the code or macro behind the listbox is using the correct column/field to filter on.
 
You are right that was a silly mistake to make but then how can I use two listboxes simultaneously?

I cannot link sub-form to two different Master/Child fields, so now if I use City list box and select Las Vegas everything works well but I then if I add another listbox with Last Name it just does not work.

Any suggestions?

Many thanks.
 

Users who are viewing this thread

Back
Top Bottom