should be so easy! form with subform datasheet to view data

G

Guest

I'm sure this is really simple but is giving me a headache!

Table 1 = list of clients (1 field of short client codes we use, each client
appears once)
Table 2 = client code /accounts used/details
We use several accounts with each client - i have set up a one-many
relationship joining the client code from 1 to 2

At the moment i can get a form that does this, but you have to scroll
through the clients record by record using the arrows at bottom -

I want to set this up so you can select the client from a drop down list to
view the information. I've been trying to copy the order form from northwind
but think i must be missing something really obvious!

please help!
 
G

Guest

Put a Combo Box in and set your row source as a query on your customer table.
Then have a sub-form, displaying the various account records based on the
value in your combo box. Also, you will need a requery statement, in the
After Update of the combo box, to requery the sub-form after a selection is
made.

HTH

Sharkbyte
 
G

Guest

Make sure your [client codes] are a key field. In table design view click on
the field and then the icon that is a key - save.
Click on menu TOOLS - Relations. Select your tables from the pulldown - it
is the icon with a yellow plus sign and grid.
Drag table1 field [client codes] to table2 field [client codes]. Click on
Referential Integrity and Cascade Update Related Fields. Save.

NOTE - you might read up on Cascade Delete Related Records.
If there is a problem in setting the relations then run this query to find
Client Codes in table2 that are not in table1.

SELECT Table1.lClient Codes, Table2.Client Codes
FROM Table1 RIGHT JOIN Table2 ON Table1.lClient Codes = Table2.Client Codes
WHERE (((Table1.lClient Codes) Is Null));
 
G

Guest

Thx -
Have set up the form/subform - but am having trouble with the requery? is
this a command i input in the expression builder? cant find much on it in
Access help.

cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Subform goes blank 1
Query is not updateable 5
Form not populating 14
A string problem 6
Can't tab through datasheet subform 2
Filter Subform 3
Missing records when they're there 2
datasheet - subforms 2

Top