[AccessD] Some vba help please

Joe Hecht jmhecht at earthlink.net
Tue Feb 21 19:12:28 CST 2006


Private Sub Accident_Date_AfterUpdate()

 

Me.txtNewAccidentID = Right(txtAccidentDate, 4) & " - " &
DMax(NewAccidentID, [20_tblAccidentmaster])

 

End Sub

 

I am trying to build a new key for each record in a table.

 

Right(txtAccidentDate, 4)  gets the year.

 

" & right(DMax(NewAccidentID, [20_tblAccidentmaster]),3)+1
gets the next sequential number.

 

1.	The code is not firing. I am getting no error or
value.
2.	Does this code look correct to my purpose.

 

 

Joe Hecht

jmhecht at earthlink.net

 




More information about the AccessD mailing list