Hello all,
I am using this error trapping code for "Delivery Date" " beforeinsert" event and it working good.
Code:
Private Sub Form_BeforeInsert(Cancel As Integer)
On Error GoTo errorline
SERIALNO = Nz(DMax("serialno", "deliveries", "OrderID=" & Forms!Orders!ORDERID)) + 1
exitline:
Exit Sub
errorline:
Select Case Err.Number
Case 3075
MsgBox " Select Department & Location First"
Cancel = True
Case Else
MsgBox " There was error in Program.Contact system Administrator"
GoTo exitline
End Select
End Sub
Now I add another event on double click to "Delivery Date"
Code:
Private Sub DELIVERYDATE_DblClick(Cancel As Integer)
DELIVERYDATE.Text = Date
So when I double click on " Delivery Date" text box then first it show me " Select department and Location First"
and when I click "OK" then the error message come runtime error "3075"
I add the error trapping code to both events then it is working but show me the msg two times, which not looking good.
I want to add one error trapping code for both events.
How I can do this?
Thanks