I
injanib via AccessMonster.com
Some one please look at the code below and tell me how I can modify it so
that the portion of the code containing:
Me![txtItemNumber] = Format(DMax("[ItemNumber]", "[Tracking]") + 1, "000000")
[TimeReceived] = Date
[Time] = Now()
NOT execute if the form is opened in edit mode. Because if I have to modify
the content of the txtFedExTest field I don't want the initial time and date
change and also the txtItemNumber field which is the record ID should also
stay the same.
Private Sub txtFedExTest_AfterUpdate()
If IsNull(Me.txtFedExTest) Or Me.txtFedExTest = "" Then
MsgBox "You must enter a tracking number.", vbOKOnly, "Data Required!"
Else
If Len([txtFedExTest]) = 32 Then
[TrackingNumber] = Mid([txtFedExTest], 17, 12)
Else
[TrackingNumber] = Me.txtFedExTest
End If
Me![txtItemNumber] = Format(DMax("[ItemNumber]", "[Tracking]") + 1,
"000000")
[TimeReceived] = Date
[Time] = Now()
End If
End Sub
Thanks allot
that the portion of the code containing:
Me![txtItemNumber] = Format(DMax("[ItemNumber]", "[Tracking]") + 1, "000000")
[TimeReceived] = Date
[Time] = Now()
NOT execute if the form is opened in edit mode. Because if I have to modify
the content of the txtFedExTest field I don't want the initial time and date
change and also the txtItemNumber field which is the record ID should also
stay the same.
Private Sub txtFedExTest_AfterUpdate()
If IsNull(Me.txtFedExTest) Or Me.txtFedExTest = "" Then
MsgBox "You must enter a tracking number.", vbOKOnly, "Data Required!"
Else
If Len([txtFedExTest]) = 32 Then
[TrackingNumber] = Mid([txtFedExTest], 17, 12)
Else
[TrackingNumber] = Me.txtFedExTest
End If
Me![txtItemNumber] = Format(DMax("[ItemNumber]", "[Tracking]") + 1,
"000000")
[TimeReceived] = Date
[Time] = Now()
End If
End Sub
Thanks allot