Hi I am having some trouble with the following code.
The if statement generates a Runtime error 424 Object Required error.
I have shecked this forum for references to Runtim error 424 and have not found anything relevent
I have tried .....
as well as
in the if statement but get the same error every time.
Any assistance would be greatly appreciated.
The if statement generates a Runtime error 424 Object Required error.
I have shecked this forum for references to Runtim error 424 and have not found anything relevent
Code:
Private Sub cmdViewReport_Click()
[B][COLOR="Red"]If Forms![frm_MainMenu]![sfrm_Reports].Form![cboSelectJobs] Is Null Then[/COLOR][/B]
On Error GoTo Err_cmdViewReport_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "pfrm_CompanyList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdViewReport_Click:
Exit Sub
Err_cmdViewReport_Click:
MsgBox Err.Description
Resume Exit_cmdViewReport_Click
Else
On Error GoTo Err_cmdViewReportWithJobs_Click
Dim stDocName2 As String
Dim stLinkCriteria2 As String
stDocName2 = "pfrm_CompanyListWithJobs"
DoCmd.OpenForm stDocName, , , stLinkCriteria2
Exit_cmdViewReportWithJobs_Click:
Exit Sub
Err_cmdViewReportWithJobs_Click:
MsgBox Err.Description
Resume Exit_cmdViewReportWithJobs_Click
End If
End Sub
I have tried .....
Code:
Forms![frm_MainMenu]![sfrm_Reports].Form![cboSelectJobs]
as well as
Code:
me.cboSelectJobs
in the if statement but get the same error every time.
Any assistance would be greatly appreciated.