Hello,
I have a module which contains the following code:
But what I'm finding is on an error, runs the debugger and I can't figure out why. It is set up so that in case an error would occur, it would pop up a msgbox and would stop the user from going further. It states sub or function not defined. I've used this error style on other codes that were on the form and they worked just fine. I haven't it before on this specific code on a specific form.
Thanks,
---roystreet
I have a module which contains the following code:
Code:
Public Function GenerateNumber(frm As Form) As Integer
On Error GoTo GenerateNumber_Err
frm.Unique_Number = Format(Nz(DMax("[DAA-MasterTable].Unique_Number", "DAA-MasterTable", "Standard_Number = '" & frm.Standard_Number & "' AND FY = '" & frm.FY & "'"), 0) + 1, "0000")
DoCmd.GoToControl "Employee_Name"
GenerateNumber_Exit:
Exit Function
GenerateNumber_Err
MsgBox "This will reflect some type of error - Possibly entering a new message since this error may occur for different reasons.", vbExclamation, "Error Generated By Number Generator Engine"
Resume GenerateNumber_Exit
End Function
Thanks,
---roystreet