Hi,
I've been stuck with this issue for quite a while so help will really be appreciated...
I have a report based on a query that shows machine utilization for a list of machines. Before loading, the report prompts dialog boxes to enter the parameters for the query: sDate and eDate (start & end dates respectively).
Each record in that report has a command button that opens another report that specifies machine errors for the single machine selected.
The new report is based on a query that receives the parameters sDate, eDate and mCode (dates and machine code). I'm trying to send the parameters from the first report to the second one so that when I open the new report, I won't have to enter anything.
I've tried different methods to send the paramaters by editing the command button's click event in vba.
startdate, enddate, machinecode are invisible textbox fields in the first report with the values I need.
But the dialog boxes prompt me to enter sDate, eDate and mCode
Another approach was to modify the query parameters for the new report using QueryDefs
Again, the dialog boxes prompt to enter sDate, eDate and mCode...
Help Please!!!
I've been stuck with this issue for quite a while so help will really be appreciated...
I have a report based on a query that shows machine utilization for a list of machines. Before loading, the report prompts dialog boxes to enter the parameters for the query: sDate and eDate (start & end dates respectively).
Each record in that report has a command button that opens another report that specifies machine errors for the single machine selected.
The new report is based on a query that receives the parameters sDate, eDate and mCode (dates and machine code). I'm trying to send the parameters from the first report to the second one so that when I open the new report, I won't have to enter anything.
I've tried different methods to send the paramaters by editing the command button's click event in vba.
startdate, enddate, machinecode are invisible textbox fields in the first report with the values I need.
Code:
DoCmd.OpenReport "rpt_MachineBreaks", acViewReport, , "sDate=" & Me.startdate & " AND eDate=" & Me.enddate &
" AND mCode=" & Me.machinecode
Another approach was to modify the query parameters for the new report using QueryDefs
Code:
Dim db As Database
Dim qry As QueryDef
Set db = CurrentDb
Set qry = db.QueryDefs("qry_singleMachineBreaks")
qry.Parameters("sDate") = Me.startdate
qry.Parameters("eDate") = Me.enddate
qry.Parameters("mCode") = Me.machinecode
DoCmd.OpenReport "rpt_singleMachineBreaks", acViewReport
Help Please!!!
Last edited: