Openform problem

andrewf10

Registered User.
Local time
Today, 18:14
Joined
Mar 2, 2003
Messages
114
Hi folks,

I've been playing around VB for days now and I've gotten nowhere on this issue. Hopefully someone can help me:


On hitting a save button on Form 1, I need a Form 2 to open + check if the current ID number exists on it.
If not then create a new record (only the ID number) in this form
If it does exist, then don't add a new record


Can someone please help me?
Any help greatly appreciated, as ever

Thanks
 
The only way Form2 should have the same ID in it is as Form1 is if Form2 is the Many side of a One to Many relalationship and the ID in Form2 is the Foreign Key in Form2. If that is the case then Form2 should be a subform of Form1. If you do that then the ID will automatically be added to Form2 when a record is added to Form2....

hth,
Jack
 
Thanks for the reply Jack

Problem is, for all sorts of reasons it's not practical for Form 2 to be a Subform of Form 1. Also the nature and number of tables makes it an even greater mess. Just to complicate things, I'm using the fantastic MouseTrap code.

Can some of you experts please try looking at this very simplified sample database, open Form1 and type in a record and see what happens. All goes to plan except that somehow, the record on Form 2 won't save without an error. My head is wrecked from it

Thanks
 

Attachments

Users who are viewing this thread

Back
Top Bottom