J
Jeff
I received some help a while back on this. I am trying to calculate a
primary key based on first initial, last initial, and a sequential 3
digit number. This is for an existing system that I inherited.
Right now, the subroutine is called after the first name or last name
fields are changed.
Private Sub Last_Name_BeforeUpdate(Cancel As Integer)
If IsNull(Me![Member ID]) Then
Me.[Member ID] = Left(Me.[First Name],1) & Left([Last Name],1) _
& Format(Nz(DMax("Val(Mid([Member ID],3)", "Member Data", _
"Left([First Name],1)='" & Left(Me.[First Name],1) & "' And "
_
& "Left([Last Name],1)='" & Left(Me.[Last Name],1) & "' ") _
, 0)+1, "000")
End If
End Sub
I'm not seeing any issues with it, but I'm getting a syntax error
message whenever it is called. Can someone tell me what I'm doing
wrong?
Thanks
Jeff
primary key based on first initial, last initial, and a sequential 3
digit number. This is for an existing system that I inherited.
Right now, the subroutine is called after the first name or last name
fields are changed.
Private Sub Last_Name_BeforeUpdate(Cancel As Integer)
If IsNull(Me![Member ID]) Then
Me.[Member ID] = Left(Me.[First Name],1) & Left([Last Name],1) _
& Format(Nz(DMax("Val(Mid([Member ID],3)", "Member Data", _
"Left([First Name],1)='" & Left(Me.[First Name],1) & "' And "
_
& "Left([Last Name],1)='" & Left(Me.[Last Name],1) & "' ") _
, 0)+1, "000")
End If
End Sub
I'm not seeing any issues with it, but I'm getting a syntax error
message whenever it is called. Can someone tell me what I'm doing
wrong?
Thanks
Jeff