Can't edit subform when adding new record

madwoman

Registered User.
Local time
Today, 04:05
Joined
Oct 20, 2005
Messages
20
I have inherited a partially completed membership Access database which I
understand was originally generated from a load of linked FoxPro tables.
There is a form which uses multiple tabs, the first tab contains general
membership data (ie name, age etc) and this pulls data through from the
'Main' table in the database. Each of the other tabs includes a subform which
shows data held in a number of different tables linked to the 'Main' table
(eg, first tab - general data from 'Main table', 2nd tab - home addreses
from 'Home Address' table, 3rd tab - business addresses from 'Business
Address' table). All tables are linked to the 'Main' table through a common
'RegisterID' field. When I open the form I can query on any of the records
and amend and items of data on the various tabs them without any problem.
However if I add a new record using the >* option from the record navigation
I can add data to the first tab (ie. into the 'Main' table) but if I move to
the 2nd or 3rd tab I am unable to edit/add data to the fields on those tabs.
But if I save the record after completing the fields on the first tab and
then close the form and reopen it I can then edit the 2nd and 3rd tabs, can
you suggest how I can change the setup to allow editing/adding data to the
2nd and 3rd tabs without having to close the form and reopen it please. I
have checked the subforms and they are set to AllowEdit and there are NoLocks.
 
Try putting this in the Change event of the TabCtl.
Code:
If Me.Dirty Then
  DoCmd.RunCommand acCmdSaveRecord
End If
 
Hi

Many thanks, this is a bit above me...how do I do this?

Cheers
 
Open the form in design mode and select the TabCtl. Go to the Event tab of the properties sheet and press the build button "..." next to the On Change line and then just paste the code I supplied before the End Sub line. Post back if you need more assistance.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom