Hi
I have a data entry form with two buttons : ADD NEW and CLOSE.
here is the code for the events
Private Sub cmdNew_Click()
DoCmd.GoToRecord acActiveDataObject, , acNewRec
Call CarryOver(Me)
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Do you want to save this record ?", vbOKCancel, "Confirm") = vbOK Then
Me!dat_dtm_timestamp = Now()
Else
Cancel = True
Exit Sub
End If
End Sub
when I enter some data the click ADD NEW, access prompts me to save or cancel.
if I click cancel I get the error 2105. that is if i don't fill in all the required fields
can anyone help ?
I have a data entry form with two buttons : ADD NEW and CLOSE.
here is the code for the events
Private Sub cmdNew_Click()
DoCmd.GoToRecord acActiveDataObject, , acNewRec
Call CarryOver(Me)
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Do you want to save this record ?", vbOKCancel, "Confirm") = vbOK Then
Me!dat_dtm_timestamp = Now()
Else
Cancel = True
Exit Sub
End If
End Sub
when I enter some data the click ADD NEW, access prompts me to save or cancel.
if I click cancel I get the error 2105. that is if i don't fill in all the required fields
can anyone help ?