P
Pamela via AccessMonster.com
Hello,
I have a case statement which is bombing at runtime. The statement is as
follows:
Case 2 'goto Routing details tab
If (CurrentRecord > Recordset.RecordCount) And (IsNull(Forms.
frmCorrespondence.ID)) Then 'adding new record
MsgBox "Must Enter Correspondence Information First!", vbExclamation,
"Required Information" 'force entry on first page
frmControls.Value = 1
DoCmd.GoToPage 1
Forms.frmCorrespondence.ID.SetFocus
'Go back to Correspondence info page
ElseIf Forms.sfrmTaskAudit.chkOther = -1 And ((IsNull(Forms.sfrmTaskAudit.
Comments)) Or (Forms.sfrmTaskAudit.Comments = "")) Then
DoCmd.Beep
' Comment required
MsgBox "Comment Required! Please Enter A Comment.", vbExclamation,
"Other Change Entered"
Forms.sfrmTaskAudit.chkEPDB.SetFocus
Forms.sfrmTaskAudit.Comments.SetFocus
' Force comment in comment field if Other is selected
frmControls.Value = 3
Else
DoCmd.GoToPage 2 'allow navigation to Page 2
End If
The statement the debugger higlights is the following:
ElseIf Forms.sfrmTaskAudit.chkOther = -1 And ((IsNull(Forms.sfrmTaskAudit.
Comments)) Or (Forms.sfrmTaskAudit.Comments = "")) Then
The message received is:
Runtime Error '438'
Object doesn't support this property or method.
I don't understand why this bombs but
If (CurrentRecord > Recordset.RecordCount) And (IsNull(Forms.
frmCorrespondence.ID)) Then
works fine (it worked before I added the above code that's bombing).
Does it have something to do with the ElseIf ? Any help would be appreciated.
Thanks!
-Pamela
I have a case statement which is bombing at runtime. The statement is as
follows:
Case 2 'goto Routing details tab
If (CurrentRecord > Recordset.RecordCount) And (IsNull(Forms.
frmCorrespondence.ID)) Then 'adding new record
MsgBox "Must Enter Correspondence Information First!", vbExclamation,
"Required Information" 'force entry on first page
frmControls.Value = 1
DoCmd.GoToPage 1
Forms.frmCorrespondence.ID.SetFocus
'Go back to Correspondence info page
ElseIf Forms.sfrmTaskAudit.chkOther = -1 And ((IsNull(Forms.sfrmTaskAudit.
Comments)) Or (Forms.sfrmTaskAudit.Comments = "")) Then
DoCmd.Beep
' Comment required
MsgBox "Comment Required! Please Enter A Comment.", vbExclamation,
"Other Change Entered"
Forms.sfrmTaskAudit.chkEPDB.SetFocus
Forms.sfrmTaskAudit.Comments.SetFocus
' Force comment in comment field if Other is selected
frmControls.Value = 3
Else
DoCmd.GoToPage 2 'allow navigation to Page 2
End If
The statement the debugger higlights is the following:
ElseIf Forms.sfrmTaskAudit.chkOther = -1 And ((IsNull(Forms.sfrmTaskAudit.
Comments)) Or (Forms.sfrmTaskAudit.Comments = "")) Then
The message received is:
Runtime Error '438'
Object doesn't support this property or method.
I don't understand why this bombs but
If (CurrentRecord > Recordset.RecordCount) And (IsNull(Forms.
frmCorrespondence.ID)) Then
works fine (it worked before I added the above code that's bombing).
Does it have something to do with the ElseIf ? Any help would be appreciated.
Thanks!
-Pamela