Have created a section in some code that opens a pre-existing form so that users can input new data. However I'm stuck at this point, basically there is a field in there called invoice number which they need to type in an invoice number (this can be anything, they just have to check it doesnt already exist)
What I would like to happen is when they click on "Add New Enquiry" a unique invoice number is generated and put into the field for them, is that possible?
Code to open the form is as follows
What I would like to happen is when they click on "Add New Enquiry" a unique invoice number is generated and put into the field for them, is that possible?
Code to open the form is as follows
Code:
Private Sub cmdAddNewEnquiry_Click()
On Error GoTo Err_cmdAddNewEnquiry_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Job"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
Forms!Job!STATUS.Value = "ENQUIRY"
Exit_cmdAddNewEnquiry_Click:
Exit Sub
Err_cmdAddNewEnquiry_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewEnquiry_Click
End Sub
Comment