Hi,
I have a Add New Record form that enters metadata for specific sites. When the data has been entered and the 'open data' button is clicked this will open to a data entry form. This data entry form has the metadata for that site along with 4 pages and subforms (each linked to a different table) for data entry.
Is there a way of forcing the 'open data' button to add a new record (e.g. an empty row with only the ID number populated) for every single table that relates to the different subforms if that ID number does not exist yet? Currently if the data entry person fails to click into to all pages/subforms and then save it will cause the site to be missing from a search form that I have created. I would like to force a record with that ID to be inserted into the different tables. This would only be required once as all tables are one-to-one related so will have the same number of rows when full entered.
I have 4 tables that I need to add a new record when the button is clicked: tblCond; tblPressure; tblSignificance; tblTypes. Just not really sure where to begin here.
The VBA code for my button so far is shown below:
Any advice is appreciated
Milos
I have a Add New Record form that enters metadata for specific sites. When the data has been entered and the 'open data' button is clicked this will open to a data entry form. This data entry form has the metadata for that site along with 4 pages and subforms (each linked to a different table) for data entry.
Is there a way of forcing the 'open data' button to add a new record (e.g. an empty row with only the ID number populated) for every single table that relates to the different subforms if that ID number does not exist yet? Currently if the data entry person fails to click into to all pages/subforms and then save it will cause the site to be missing from a search form that I have created. I would like to force a record with that ID to be inserted into the different tables. This would only be required once as all tables are one-to-one related so will have the same number of rows when full entered.
I have 4 tables that I need to add a new record when the button is clicked: tblCond; tblPressure; tblSignificance; tblTypes. Just not really sure where to begin here.
The VBA code for my button so far is shown below:
VBA Code:
Private Sub btnOpenPlot_Click()
If Not IsNull(Me![ID]) Then
DoCmd.Save acForm, "Test"
Me.Refresh
DoCmd.OpenForm "Test2", , , "[ID] =" & Me![ID], , , Me![ID]
End If
End Sub
Any advice is appreciated
Milos