C
Chris
I have the following code and get an error Run time error
2471. The expression you entered as a query parameter
produced this error: The object doesn't contain the
Automation object 'Forms!fsubFinishedAudit!
TblFinishedAudit_txtQuestionNumber.'
The code works fine in the sub form but when I try and use
it in the main form I get the above error. Here is the
code.
Private Sub txtPlant_BeforeUpdate(Cancel As Integer)
Dim iAns As Integer
If Not IsNull(DLookup("Forms![fsubFinishedAudit]!
[TblFinishedAudit_txtQuestionNumber]", "TblFinishedAudit",
"[TblFinishedAudit]![txtQuestionNumber] = Forms!
[fsubFinishedAudit]!
[TblFinishedAudit_txtQuestionNumber]")) Then
iAns = MsgBox("This Question has already been answered!
Use it anyway?", vbYesNo)
If iAns = vbNo Then
Cancel = True
Forms![fsubFinishedAudit]!
[TblFinishedAudit_txtQuestionNumber].Undo
End If
End If
End Sub
2471. The expression you entered as a query parameter
produced this error: The object doesn't contain the
Automation object 'Forms!fsubFinishedAudit!
TblFinishedAudit_txtQuestionNumber.'
The code works fine in the sub form but when I try and use
it in the main form I get the above error. Here is the
code.
Private Sub txtPlant_BeforeUpdate(Cancel As Integer)
Dim iAns As Integer
If Not IsNull(DLookup("Forms![fsubFinishedAudit]!
[TblFinishedAudit_txtQuestionNumber]", "TblFinishedAudit",
"[TblFinishedAudit]![txtQuestionNumber] = Forms!
[fsubFinishedAudit]!
[TblFinishedAudit_txtQuestionNumber]")) Then
iAns = MsgBox("This Question has already been answered!
Use it anyway?", vbYesNo)
If iAns = vbNo Then
Cancel = True
Forms![fsubFinishedAudit]!
[TblFinishedAudit_txtQuestionNumber].Undo
End If
End If
End Sub