Save record before jumping to sub form

Shallo9

Registered User.
Local time
Today, 09:38
Joined
Nov 11, 2011
Messages
95
I am relatively new to access as have been working with C Stream earlier.

I want to save a record in the main table when tab control gets the focus in access. I've tried RunCommand DoCmd.Save with no success. I've also used

If Me.Dirty Then Me.Dirty = False but i still get an error msg saying parent record needs to be saved or doesn't exists.

I am using Access 2010.

Thanking you in advance.
 
A record in the main form will be saved when you move to the subform - assuming you are using the link master and link child to link the subform to the parent form.

I suggest that you remove any code from the On Focus event for the tab control and just check that the parent record does save in the table when you tab into the subform.
 
an easy way to test this is to include record selectors in the main form, temporarily

a clean record shows a black triangle in the LHS - and a dirty record shows a pencil.
 

Users who are viewing this thread

Back
Top Bottom