B
Brennan
Hello:
I have attached the follwoing code to a command button on
a form:
Dim strProjectManager As String
strProjectManager = "tblEstimators_EstimatorID = Me!
lstProjectManager"
If IsNull(Me!lstProjectManager) Then
DoCmd.OpenReport "rptPipeline_byProjectManager",
acViewPreview
Else
DoCmd.OpenReport "rptPipeline_byProjectManager",
acViewPreview, , strProjectManager
End If
Forms!Switchboard.Visible = False
Forms!frmReports.Visible = False
End Sub
The code should look at a list box containing project
managers and if null, return records for all the managers
or for a specific project manager if one is selected
Whe I run the report, the debugger opens and I get the
following error:
Run-time error 3070
The Microsoft Jet database engine does not recognize 'Me!
lstProjectManager' as a valid field name or expression.
If I remove the strProjectManager from the respective
open report command, the code runs.
Any ideas on what is wrong with my code would be
appreciated.
Thanks
Brennan
I have attached the follwoing code to a command button on
a form:
Dim strProjectManager As String
strProjectManager = "tblEstimators_EstimatorID = Me!
lstProjectManager"
If IsNull(Me!lstProjectManager) Then
DoCmd.OpenReport "rptPipeline_byProjectManager",
acViewPreview
Else
DoCmd.OpenReport "rptPipeline_byProjectManager",
acViewPreview, , strProjectManager
End If
Forms!Switchboard.Visible = False
Forms!frmReports.Visible = False
End Sub
The code should look at a list box containing project
managers and if null, return records for all the managers
or for a specific project manager if one is selected
Whe I run the report, the debugger opens and I get the
following error:
Run-time error 3070
The Microsoft Jet database engine does not recognize 'Me!
lstProjectManager' as a valid field name or expression.
If I remove the strProjectManager from the respective
open report command, the code runs.
Any ideas on what is wrong with my code would be
appreciated.
Thanks
Brennan