I have done this before and I cannot remember what I did.
I used a DLOOKUP and grabbed the number in previous record field InvNo and added 1 to it.
So if last record InvNo was 14750 then in new record InvNo was defaulted to 14751
I can use this code to copy forward text fields. I thought I could modify it to update my InvNo field but I cannot figure it out. I need this in the default value of the InvNo field.
Private Sub NewRecClockIn_Click()
Dim ID As Long
ID = QuoteID
DoCmd.GoToRecord , , acNewRec
location = DLookup("location", "tblUserQuotes", "QuoteID=" & ID)
UserFK = DLookup("UserFK", "tblUserQuotes", "QuoteID=" & ID)
cmdClose.SetFocus
End Sub
Thank you.
I used a DLOOKUP and grabbed the number in previous record field InvNo and added 1 to it.
So if last record InvNo was 14750 then in new record InvNo was defaulted to 14751
I can use this code to copy forward text fields. I thought I could modify it to update my InvNo field but I cannot figure it out. I need this in the default value of the InvNo field.
Private Sub NewRecClockIn_Click()
Dim ID As Long
ID = QuoteID
DoCmd.GoToRecord , , acNewRec
location = DLookup("location", "tblUserQuotes", "QuoteID=" & ID)
UserFK = DLookup("UserFK", "tblUserQuotes", "QuoteID=" & ID)
cmdClose.SetFocus
End Sub
Thank you.