Another save/cancel record question

edster

Registered User.
Local time
Today, 13:20
Joined
Sep 25, 2004
Messages
31
Hi
Ive just come across a problem, i used the code basics from the example database 'FormSave' which resulted in what i wanted - a working cancel button and a save button on a form, brilliant however this is what i descovered when i came to test it:

The form has a subform which is linked to the main form by a [BatchID] field. The main form has to/from adresses and an expiry date. The subform has a list of serial numbers of products in each batch.

Basically the save/cancel buttons work fine - as i guess there designed to - on the main form however whenever i try and move focus to the subform the info in the main form is deleted (canceled). Is there any way round this?

I need the subform so am thinking of just taking the buttons and code off but i would really like them to work.

Hope ive made it clear enough
Many thanks in advance

Ed
 
Ed,

I'd forget about the buttons altogether.

Link the Main/Subform with the Master-Child relationships.

Use Tools --> Relationships to define the relationship between the
two tables. Check the Enforce Referential Integrity checkbox and
also check "Cascade deletes" and "Cascade Updates".

Then you'll need no code and Access will do all the work.

Wayne
 

Users who are viewing this thread

Back
Top Bottom