B
Betty via AccessMonster.com
The following is my code in a standard module to save data entry records. It
saves to the table but does not clear the form to add an additional new
record: The query saves the subform records.
Public Function AddRcd_Click()
Dim JobOrder As Long
Dim frmActive As Form
Set frmActive = Screen.ActiveForm
On Error GoTo Err_AddRcd_Click
If (IsNull([JobOrder])) Then
' If no Job Order selected, stop procedure
MsgBox "You Must Enter A Job Order#"
Cancel = True
Exit Function
Else
DoCmd.OpenQuery "qryAppendToEvent"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
End If
Exit_AddRcd_Click:
Exit Function
Err_AddRcd_Click:
MsgBox "Error While Trying To Add Record"
Resume Exit_AddRcd_Click
End Function
Thanks,
Betty
saves to the table but does not clear the form to add an additional new
record: The query saves the subform records.
Public Function AddRcd_Click()
Dim JobOrder As Long
Dim frmActive As Form
Set frmActive = Screen.ActiveForm
On Error GoTo Err_AddRcd_Click
If (IsNull([JobOrder])) Then
' If no Job Order selected, stop procedure
MsgBox "You Must Enter A Job Order#"
Cancel = True
Exit Function
Else
DoCmd.OpenQuery "qryAppendToEvent"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
End If
Exit_AddRcd_Click:
Exit Function
Err_AddRcd_Click:
MsgBox "Error While Trying To Add Record"
Resume Exit_AddRcd_Click
End Function
Thanks,
Betty