G
Guest
Hi, can someone help me with this? Im trying to put a save button on a bottom
of a data entry form. So only when the user clicks on the save button, the
record is written into the database.
So far, I created another temp table to store the data for the form and
append it to the main database when the save button is clicked. But Whenever
I click on the save button, the form will go to a new record although the
saving works perfectly. Is there a better solution to do this saving
function? The database seems to grow in size rather quickly with the
inserting and deleting of temp data.
Heres my code for the save button.
If mbRequireSave Or Me.Dirty Then
DoCmd.Requery
DoCmd.SetWarnings False
If IsNull(DLookup("ReportID", "9000_Data", "[ReportID] = '" &
Me.txtReportID & "'")) Then
DoCmd.RunSQL "INSERT INTO [9000_Data] SELECT [9000_DataEntry].*
FROM [9000_DataEntry] WHERE [ReportID] = '" & Me.ReportID & "'"
End If
DoCmd.SetWarnings True
mbRequireSave = False
Else
MsgBox "Record Exist in Database."
End If
of a data entry form. So only when the user clicks on the save button, the
record is written into the database.
So far, I created another temp table to store the data for the form and
append it to the main database when the save button is clicked. But Whenever
I click on the save button, the form will go to a new record although the
saving works perfectly. Is there a better solution to do this saving
function? The database seems to grow in size rather quickly with the
inserting and deleting of temp data.
Heres my code for the save button.
If mbRequireSave Or Me.Dirty Then
DoCmd.Requery
DoCmd.SetWarnings False
If IsNull(DLookup("ReportID", "9000_Data", "[ReportID] = '" &
Me.txtReportID & "'")) Then
DoCmd.RunSQL "INSERT INTO [9000_Data] SELECT [9000_DataEntry].*
FROM [9000_DataEntry] WHERE [ReportID] = '" & Me.ReportID & "'"
End If
DoCmd.SetWarnings True
mbRequireSave = False
Else
MsgBox "Record Exist in Database."
End If