List box's and query help

Kernel Kev

New member
Local time
Today, 19:17
Joined
Feb 25, 2008
Messages
6
Ok, this kinda involves a number of things so i wasnt too sure where to place this thread. As its all based around a form i figure thats the one for me.

Ok i am trying to create a tilling system for my college coursework and i have a good idea on how the data will be entered with the use of sub forms etc etc... but i have hit a solid wall that no matter how many millions of pages google searchs i just cant get over the wall.

---TABLES---

Products
Transactions
Sales

---THEORY---

Each sale belongs to 1 transaction so S1001 and S1002 will have a record of T1001 etc etc(s=sale t=transaction) So now i want a list box to run off a query that displays the sales of the current transaction i am on. I have worked out how this can be done by using the [insert transaction number] in criteria but i want it automatic.

---QUESTION---

How can this be done, do i need to use macros (if so what functions) or does it have to be in VB or can i do it in the design view of the query?

Any help would be appreciated massively.

Thanks



Kev
:cool:
 
If I've understood you correctly you want your query to use the current Transaction ID as a criteria. If so all you need to do is put the following code in the criteria under Transaction ID;
Code:
Forms!FormName!TransactionID

Where FormName is the name of your form and TransactionID is the name of the control on the form that contains the Transaction ID you wish to use as your criteria.
 
Ok thanks that works, now i have a slight problem from here... though i know its not major.

How do i get the list to lookup the query each time i change record on the form? As its not updating the subform when i change the main form from T1001 to T1002 for example.



Kev
:cool:
 
Of the form I guess. So every time you change record, the qry will run. No idea if it's right, just throwing ideas out there.
 

Users who are viewing this thread

Back
Top Bottom