Good morning Access Gurus!! I have implemented a line in my code to create or assign the next reference number (SNAP-R Reference), which is AlphaNumeric ($$$####) - this is a mandatory Format. However, I am receiving an error,
"Syntax Error (missing operator) in query expression 'MAX(SNAP-R Reference)'."
Here is my code:
Function Enter_New_Commerce_License_Submission()
On Error GoTo Enter_New_Commerce_License_Submission_Err
DoCmd.Close acForm, "Commerce License Processing Menu"
DoCmd.OpenForm "New Commerce License", acNormal, "", "", acEdit, acNormal
DoCmd.GoToRecord acForm, "New Commerce License", acNewRec
Nz (DMax("SNAP-R Reference", "Commerce Licenses", "SNAP-R Date=" & Year(Date))), 0 + 1
Enter_New_Commerce_License_Submission_Exit:
Exit Function
Enter_New_Commerce_License_Submission_Err:
MsgBox Error$
Resume Enter_New_Commerce_License_Submission_Exit
End Function
What I would like to accomplish is this: When I click the button on my form to "Add a new Commerce License Application", the Form to enter the details opens, with the next SNAP-R Reference calculated and populated in its proper field. Is this an easy correction? I'm sorry if this is a basic question, but as my profile indicates, I have zero programming back-ground.
THANK YOU!!!!