Please Help

maniatis

Registered User.
Local time
Tomorrow, 01:03
Joined
Sep 22, 2005
Messages
31
The Main Idea Is:
I Have A Table With The Following Fields:
Location Agent Name Adress Telephone Fax Email.

I Want In A Form In A Combo Box With The Field Location To Choose A Location And The Form Brings Me The Records Of The Rest Of The Fields For The Subject Location.

I Tried To Follow The Example Of The Sample Northwind Database But It Didn't Work Could You Suggest Sth?
 
Create your form and place an extra field with the locations in your header-part. Then create a query containing all your table fields. In the query-condition of your Location-field, place a reference to the top-most location-field on your form (ie [Forms]![Form1]![lstLocations]). Use this query as the recordsource for your form.

That way, if you select a location and refresh the form, you'll get only your agents from that location.

Good luck!

Greetz,

Seth
 
( place a reference to the top-most location-field on your form):what do you mean by that?i ask you because i tried building a query but it didn't worked.thanx for your help.
 
I mean that you should make a listbox, containing all the locations you have in your database. Name it lstLocations.

In your query, in the criteria of your Location-field, you have to place a reference to that listbox on your form. That way, the query will only return the records where the location equals the selected location in the list. That reference should be [Forms]![NameOfYourForm]![lstLocations].

Also, make sure this query is the recordsource for your form. When you have selected a location in your list, refresh the form (either by pressing F9 or by VBA-coding). You will now see only the records where the location is the one you have selected in your list.

Greetz,

Seth
 
not working. do you know how to do it with combobox?i tried it but it inly returns me the values in the combobox and not the records to the other fields
 
Can you upload the database? i'll show you what i mean.

Seth
 
i want to thank you a lot.my mistake was that i was uploading all fields as i noticed and you load only records matching the criteria.one final question if i use it to make a form with linked tables using a query will it bring all the records except the agent details? many thanx
 
No, it will only load the orders of whom the agents correspond to the selected location.

It was my pleasure! :-)

Seth
 

Users who are viewing this thread

Back
Top Bottom