Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two linked forms problem

Status
Not open for further replies.

MarkWaddington

Programmer
Aug 19, 2002
64
GB
Hi there, I hope somebody can help me out here - this has been driving me crazy. I'm not terribly technically minded, so please go easy on me!

I have two linked forms on my database, "Clients" and "Employment History"

The underlying tables have a One-to-One relationship where I have linked the Autonumber for "Clients" with an Employment History Number (which is not an Autonumber).

On my client form I have added a command button where if you click it, it brings up the form for the corresponding employment history.

Everything seems to work fine except for this ONE scenario:

Imagine I have a client record with for example, the Autonumber of "7", for this client I do not have any employment history details, so I do not need to use the Employment History form..

I make a new client record "8" and this person DOES have employment details, so I click the command button, the form opens, and I type in the employment history.

Now when I try to save this I get the following error message:

"You cannot add or change a record because a related record is required in table: 'Client'"

Obviously what is happening is that Access cannot generate a record for the Employment History form unless all previous Client records have corresponding Employment History records that EXIST.

In an ideal world everyone would have their employment details, but I know this will cause problems for people if they try to generate an Employment History record for a client where a previous employment history record has not yet been generated.

PLEASE, i'm begging you, please help me figure out how to get round this!

Much obliged.

Mark Waddington.
 
Silly me, I forgot to do a recalc when I opened the popup form!

Problem sorted :)
 
Dear Mark

Sometimes thinking about the problem enough to write a question to post here greases up the old brain cogs! It happens to me a lot. No-one said Tek-Tips couldnt be used to help answer your own questions!

Long Live TekTips!!!! [thumbsup2]

Toby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top