Getting related forms to work

I

Isidore

I have two two tables: CLIENTS and VISITS.

CLIENTS contains client contact info. Key field is ClientID.

VISITS contains information about meetings I have with clients. Each
meeting gets one record. Key field in ClientDetailsID. It has a
ClientID field, by which it is related to CLIENTS in a one (CLIENTS)
to many (VISITS) relationship.

I created a form for each of these tables. My problem: How can I get
each new record I make in the VISITS table to automatically pick up
the ClientID from the CLIENTS table? I've tried many ways of doing
this with no luck and it's driving me batty because I know this should
be easy.

Can anyone explain the process clearly, or point me to someplace with
instructions that are friendlier than Microsoft's? Any help would be
greatly appreciated.

Thanks in advance,
Isidore
 
G

Guest

Isabel -

Try building the form structure in a query and base your
form off of that query instead of the tables. Link the two
tables by the common field (ClientID?) and you should be
ready to go.
I have found that to be much easier, especially when I
need to add another field down the road.

Good Luck!
 
S

Stephen Glynn

Isidore said:
I have two two tables: CLIENTS and VISITS.

CLIENTS contains client contact info. Key field is ClientID.

VISITS contains information about meetings I have with clients. Each
meeting gets one record. Key field in ClientDetailsID. It has a
ClientID field, by which it is related to CLIENTS in a one (CLIENTS)
to many (VISITS) relationship.

I created a form for each of these tables. My problem: How can I get
each new record I make in the VISITS table to automatically pick up
the ClientID from the CLIENTS table? I've tried many ways of doing
this with no luck and it's driving me batty because I know this should
be easy.

Can anyone explain the process clearly, or point me to someplace with
instructions that are friendlier than Microsoft's? Any help would be
greatly appreciated.

Thanks in advance,
Isidore

The simplest way to do it is to use the Forms Wizard to create a form
with a subform. Just tell it you want it to include both tblCLIENTS
and tblVISITS in your form and, assuming the relationships are properly
set, it will create the form for you automatically.

Steve
 
I

Isidore

I have tried that, and apparently I'm doing something wrong. I put
all of the fields from both tables into the query and based both form
on that. When I put those fields onto the forms, they have names like
"tblclients.clientID" and "tblvisits.clientID". I assume
"tblclients.clientID" goes on the Clients form and
"tblvisits.clientID" goes on the Visitors form.

Then, when I try to enter data, (a) the ID number doesn't appear, and
(b) I get an error message that reads "The LinkMasterFields property
setting has produced this error: "The object doesn't contain the
Automation object "tblClients". This is totally meaningless to me.
I'm obviously going about this the wrong way.

Should I be basing my forms on 2 queries with fewer fields? How do
you do it? Yikes!

Thanks for the effort,
Isidore
 

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

Top