I'm using the following code to pass a value (which will eventually be contained in a text string) to a query/procedure
However there are a further 7 queries which I need to run using a macro called Generate New Format Report: the macro just opens the 8 queries together.
I can use the line
DoCmd.RunMacro "Generate New Format Report"
to run the macro but don't know how to pass the parmater to this: I'm assuming the code will be similar to the above, or i can somehow loop to get the value to pass to each query in turn
PHP:
Sub TestCmd()
Dim Cat As Object
Set Cat = CreateObject("ADOX.Catalog")
With Cat
.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=S:\Reporting database.mdb"
Dim cmd As Object
Set cmd = .Procedures("Top 5 Reason codes").Command
End With
With cmd
.Parameters("[forms]![subform]![combo58]").Value = "dept code"
.Execute
End With
End Sub
However there are a further 7 queries which I need to run using a macro called Generate New Format Report: the macro just opens the 8 queries together.
I can use the line
DoCmd.RunMacro "Generate New Format Report"
to run the macro but don't know how to pass the parmater to this: I'm assuming the code will be similar to the above, or i can somehow loop to get the value to pass to each query in turn