Updating a listbox according to the record you're viewing

MarcD

New member
Local time
Today, 06:04
Joined
Apr 30, 2005
Messages
6
Hi

I have a database containing 3 tables (for now):
Customers
Orders
Catagories

Now i also have a form with customer information.
In that form is a listbox with a query statement, so that should display wich orders are placed by that customer.

SELECT Orders.[Order-ID], Orders.Description, Orders.Date, Orders.Category FROM Orders WHERE Customer=[Customer-ID];


Now this works for the first costumer record being displayed.
However when i view the next costumer, the listbox still displays the order information from the first customer.

How can i get the listbox to update itself when a diffirent record is viewed?

Thanks in advance
 
You need to place some code in the On Current event of the form.

Your listbox name = customerID

Pete
 
Thank you for your reply.
Unfortunatly, i still havent gotten it to work.

Does it make any diffirence if i say i use Access 2002?
 
In the On Current Event of the form put

Code:
 Me.Requery
 
Thank you, it didn't work at first but now it does.
The listbox name is Orders
After making the code
Code:
Orders.Requery

It worked.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom