R
richard
Hi
I have a form (frmeeaquote), based on tbleeaquote, for inputting details of
quotes. I wish to have an incrementing order number (field 'quoteref').
I have a command button on the form to create new records and have the
following code but I am not getting an incrementing value in the 'quoteref'
field.
Could someone please advise where I am going wrong
Private Sub cmdnewquote_Click()
On Error GoTo Err_cmdnewquote_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdnewquote_Click:
Exit Sub
Err_cmdnewquote_Click:
MsgBox Err.description
Resume Exit_cmdnewquote_Click
Me!quoteref = Nz(DMax("[quoteref]", "[tbleeaquote]"), 0) + 1
End Sub
thanks
Richard
I have a form (frmeeaquote), based on tbleeaquote, for inputting details of
quotes. I wish to have an incrementing order number (field 'quoteref').
I have a command button on the form to create new records and have the
following code but I am not getting an incrementing value in the 'quoteref'
field.
Could someone please advise where I am going wrong
Private Sub cmdnewquote_Click()
On Error GoTo Err_cmdnewquote_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdnewquote_Click:
Exit Sub
Err_cmdnewquote_Click:
MsgBox Err.description
Resume Exit_cmdnewquote_Click
Me!quoteref = Nz(DMax("[quoteref]", "[tbleeaquote]"), 0) + 1
End Sub
thanks
Richard