Dynamic query sort of thing

H

halfbodyguy

OK, I am new and tasked with making a dispatch database.


We have customer numbers such as 100443.002


in that the .002 is the delivery address and the 100433 is the specific

person or company.


I need to have a setup where when filling in the form information, I
can enter the customer number, then have the Delivery location be a
list of ONLY delivery locations tied to that Customer.


For example with each customer I have fields set up as such:


ADDRESSTABLE


CUSTOMERNUMBER DELIVERYNUMBER ADDRESS
110029 001 123Wherever St
110029 002 865 Myhouse st
110040 001 thisplace road
110040 003 myoldplace


ORDERTABLE


ORDER NUMBER CUSTOMER NUMBER DELIVERYNUMBER OTHERFIELDS
5540019 110029 002(dropdown) xxxxxxxxxxx
5540020 110040 003(dropdown) xxxxxxxxxxx


Now i want to select the customer number in a form (or preferably setup

from the table) and then when I go to the address field, the only
options I have are those with the same customer number as the field I
am working in.


I assume this will probably require a query, but I can't quite seem to
get it right... Any Ideas?
 
A

Allen Browne

If you are designing this database, use 2 separate fields for CustomerID and
AddressID. You can then display them on a print out as:
=[CustomerID] & "." & [AddressID]

Now you can have 2 separate combos for the customer and address, and you can
use the Enter event of the second one to set its RowSource. Details in:
Limit content of combo/list boxes
at:
http://www.mvps.org/access/forms/frm0028.htm
 
Top