I was using the below code in a test database and it was working. But since I have added the information to my active database I am getting this error: "Method or data number not found".
The code is:
The error is going straight to the line starting with
I haven't changed any field/control names, table names. Not sure what went wrong between the test and the active database. The only difference is that my test was created in MS Access 2016 but my active database is in MS Access 2010. I typed over/copy and pasted the majority of the info...I didn't try to merge into the existing database.
Can someone please help.
The code is:
Code:
Private Sub InstructionNo_GotFocus()
If Me.cboContractNo = 0 Then
MsgBox "Contract number must be entered first!", vbOKOnly
Me.cboContractNo.SetFocus
Else
Me.CVINo = Nz(DMax("[CVINo]", "TBLCVI", "[ContractNo] = " & Me.[cboContractNo]), 0) + 1
End If
End Sub
The error is going straight to the line starting with
Code:
Me.CVINo = Nz(DMax...
I haven't changed any field/control names, table names. Not sure what went wrong between the test and the active database. The only difference is that my test was created in MS Access 2016 but my active database is in MS Access 2010. I typed over/copy and pasted the majority of the info...I didn't try to merge into the existing database.
Can someone please help.