G
Guest
I need to find the Max number in a table txtGlucometer# field and then add 1
to it the new number is entered in the txtGlucometer# for the person. I am
using this code
Private Sub txtNumberNeeded_AfterUpdate()
Dim NewID As String
Dim OldID As String
If txtNumberNeeded = True Then
OldID = Nz(DMax("txtGlucometer#", "tblGlucometer"), "0")
NewID = Format(OldID + 1)
Me.txtGlucometer# = NewID
ElseIf txtNumberNeeded = False Then
Me.txtGlucometer# = "0"
End If
End Sub
But it is getting hung up on the OldID line. Can someone help me out, I
don't have access to my books and need to get this done. Thanks Fay
to it the new number is entered in the txtGlucometer# for the person. I am
using this code
Private Sub txtNumberNeeded_AfterUpdate()
Dim NewID As String
Dim OldID As String
If txtNumberNeeded = True Then
OldID = Nz(DMax("txtGlucometer#", "tblGlucometer"), "0")
NewID = Format(OldID + 1)
Me.txtGlucometer# = NewID
ElseIf txtNumberNeeded = False Then
Me.txtGlucometer# = "0"
End If
End Sub
But it is getting hung up on the OldID line. Can someone help me out, I
don't have access to my books and need to get this done. Thanks Fay