Hi,
Looked at the doCmd.OpenReport in the one database, but up front they called a control for lstReport (the report box) and named a string CONACTION. I tried editing my button with the doCmd.Open Report arguments and it didn't recognize the keywords. I think I am missing a control on the form, the ctllstReport they reference. I guess I'll go back to the button for each report idea, there's only 10 reports so that's not too bad!
Here's the front of the code I was trying to copy:
Option Compare Database
Option Explicit
Dim ctltabReport As Control
Dim pgeMain As Page
Dim pgeBatch As Page
Dim pgeFilter As Page
Dim ctlcmdNew As Control
Dim ctlcmdDelete As Control
Dim ctlcmdPrint As Control
Dim ctlcmdPreview As Control
'Main page
Dim ctllstReport As Control
Dim ctllstGroup As Control
Dim ctltxtFrom As Control
Dim ctltxtTo As Control
Dim ctlcboproperty As Control
Dim ctltxtDateName As Control
Dim ctltxtDescription As Control
'Batch page
Dim ctllstBatch As Control
Dim ctllstAvailable As Control
Dim ctlcboName As Control
'Filter page
Dim ctllstProperty As Control
Dim ctllstAsset As Control
Dim ctllstLabor As Control
Private Function DoReports(CONACTION As String)
On Error GoTo DoReports_err
Dim varitem As Variant
Dim intI As Integer
Dim strFilter As String
If ctltabReport.Value = 1 Or ctltabReport.Value = 2 Then
MsgBox "Select the Reports tab or the Batch tab to print or print preview.", vbInformation, "Message"
Exit Function
End If
'page Main
If ctltabReport.Value = 0 Then
If ctllstReport.ItemsSelected.count = 0 Then
MsgBox "Select a Report.", vbInformation, "Message"
Exit Function
End If
DoCmd.Echo False, "Opening reports"
With ctllstReport
For Each varitem In .ItemsSelected
strFilter = .Column(5, varitem)
'check if date range is required
If IsNull(ctltxtTo) Or IsNull(ctltxtFrom) Then
If .Column(3, varitem) = -1 Then
MsgBox "Report requires a date range.", vbInformation, "Message"
DoCmd.Echo True
Exit Function
End If
End If
Select Case strFilter
Case "Property"
If IsNull(ctllstProperty) = False Then
DoCmd.OpenReport .Column(0, varitem), CONACTION, , "[Property]= " & FFFixQuotes(Forms!frmReport!lstProperty)
Else
DoCmd.OpenReport .Column(0, varitem), CONACTION
End If
Case "Asset"
If IsNull(ctllstAsset) = False Then
DoCmd.OpenReport .Column(0, varitem), CONACTION, , "[Asset]= " & FFFixQuotes(Forms!frmReport!lstAsset) & "And" & "[property]= " & FFFixQuotes(Forms!frmReport!lstProperty)
Else
DoCmd.OpenReport .Column(0, varitem), CONACTION
End If
Case "Labor"
If IsNull(ctllstLabor) = False Then
DoCmd.OpenReport .Column(0, varitem), CONACTION, , "[Labor]= " & FFFixQuotes(Forms!frmReport!lstLabor)
Else
DoCmd.OpenReport .Column(0, varitem), CONACTION
End If
Case Else