hi,If u have enought time, try this
This is the way I do now. But I have 200 report need difference para.
Create a form
place a button.
Insert Button_click()
'If check_valid() = False Then Exit Sub
'Dim MainSQL As String
Dim TEMPSQL As String
Dim a_tmsql As String
Dim Criteria As String, mydb As Database, myset As Recordset, TableHeader As Recordset, FilteredSet As Recordset
Dim A As Integer
Set mydb = DBEngine.Workspaces(0).Databases(0)
Set myset = mydb.OpenRecordset("Reports", DB_OPEN_DYNASET) ' Create dynaset.
myset.Filter = "[ReportID] = " & Me![reportList].Column(2)
Set myset = myset.OpenRecordset() ' Create filtered dynaset.
If myset.EOF Then Exit Sub
TEMPSQL = ""
If Not IsNull(myset![selector1]) Then
If selector1 = 1 Then
'
'
Else
TEMPSQL = ("[" & myset![selector1] & "] = " & Chr(39) & Me!selector1Item & Chr(39))
End If
End If
If Not IsNull(myset![selector2]) Then
If selector2 = 1 Then
Else
sql1 = ""
If IsNull(FromDate) Then
sql1 = ("[" & myset![selector2] & "]" & "<=#" & ToDate & "#"

'&&980730
Else
'where [CASHDATE] BETWEEN '" & a_from_date & "' AND '" & a_to_date & "'"
'SQL1 = ("[" & myset![selector2] & "] >= " & "#" & FromDate & "#" & " AND " & "[" & myset![selector2] & "]" & "<=#" & ToDate & "#"

'&&y2k1005
sql1 = ("[" & myset![selector2] & "] >= '" & FromDate & "' AND " & "[" & myset![selector2] & "]" & "<= '" & ToDate & "'"

'&&y2k1005
End If
'SQL1 = ("[" & myset![selector2] & "] >= " & "#" & FromDate & "#" & " AND " & "[" & myset![selector2] & "]" & "<=#" & ToDate & "#"

'&&980730
If (TEMPSQL <> ""

Then
'TempSQL = TempSQL & " AND " & ("[" & myset![selector2] & "] >= " & "#" & FromDate & "#" & " AND " & "[" & myset![selector2] & "]" & "<=#" & ToDate & "#"

''&&980730
TEMPSQL = TEMPSQL & " AND " & sql1
Else
'TempSQL = ("[" & myset![selector2] & "] >= " & "#" & FromDate & "#" & " AND " & "[" & myset![selector2] & "]" & "<=#" & ToDate & "#"

''&&980730
TEMPSQL = sql1 ''&&980730
'SQL1
End If
End If
End If
If Not IsNull(myset![selector3]) Then
If selector3 = 1 Then
Else
If (TEMPSQL <> ""

Then
' If Not IsNull(TempSQL) Then
TEMPSQL = TEMPSQL & " AND " & ("[" & myset![selector3] & "] = " & Chr(39) & Me!selector3Item & Chr(39))
Else
TEMPSQL = ("[" & myset![selector3] & "] = " & Chr(39) & Me!selector3Item & Chr(39))
End If
End If
End If
If Not IsNull(myset![selector4]) Then
If selector4 = 1 Then
Else
If (TEMPSQL <> ""

Then
'If Not IsNull(TempSQL) Then
TEMPSQL = TEMPSQL & " AND " & ("[" & myset![selector4] & "] = " & Chr(39) & Me!selector4Item & Chr(39))
Else
TEMPSQL = ("[" & myset![selector4] & "] = " & Chr(39) & Me!selector4Item & Chr(39))
End If
End If
End If
If Not IsNull(myset![selector5]) Then
If selector5 = 1 Then
Else
If (TEMPSQL <> ""

Then
' If Not IsNull(TempSQL) Then
TEMPSQL = TEMPSQL & " AND " & ("[" & myset![selector5] & "] = " & Chr(39) & Me!selector5Item & Chr(39))
Else
TEMPSQL = ("[" & myset![selector5] & "] = " & Chr(39) & Me!selector5Item & Chr(39))
End If
End If
End If
If Not IsNull(myset![selector6]) Then
If selector6 = 1 Then
Else
If (TEMPSQL <> ""

Then
'If Not IsNull(TempSQL) Then
TEMPSQL = TEMPSQL & " AND " & ("[" & myset![selector6] & "] = " & Chr(39) & Me!selector6Item & Chr(39))
Else
TEMPSQL = ("[" & myset![selector6] & "] = " & Chr(39) & Me!selector6Item & Chr(39))
End If
End If
End If
If Not IsNull(myset![selector7]) Then
If selector7 = 1 Then
Else
If (TEMPSQL <> ""

Then
'If Not IsNull(TempSQL) Then
TEMPSQL = TEMPSQL & " AND " & ("[" & myset![selector7] & "] = " & Chr(39) & Me!selector7Item & Chr(39))
Else
TEMPSQL = ("[" & myset![selector7] & "] = " & Chr(39) & Me!selector7Item & Chr(39))
End If
End If
End If
If Not IsNull(myset![selector8]) Then
If selector8 = 1 Then
Else
sql1 = ""
If IsNull(selector8Frm) Then
'SQL1 = ("[" & myset![selector8] & "]" & "<='" & selector8To & "'"

'&&991214
sql1 = ("[" & myset![selector8] & "]" & "<=#" & selector8To & "#"

'
Else
'SQL1 = ("[" & myset![selector8] & "] >= " & "'" & selector8Frm & "'" & " AND " & "[" & myset![selector8] & "]" & "<='" & selector8To & "'"

'&&980730
sql1 = ("[" & myset![selector8] & "] >= " & "#" & selector8Frm & "#" & " AND " & "[" & myset![selector8] & "]" & " <=#" & selector8To & "#"

'&&980730
'SQL1 = ("[" & myset![selector2] & "] >= " & "#" & FromDate & "#" & " AND " & "[" & myset![selector2] & "]" & "<=#" & ToDate & "#"

'&&y2k1005
End If
If (TEMPSQL <> ""

Then
'If Not IsNull(TempSQL) Then
TEMPSQL = TEMPSQL & " AND " & sql1
Else
TEMPSQL = sql1 ''&&980730
End If
End If
End If
a_tmsql = TEMPSQL
If (Me![reportList].Column(2) = 225 Or Me![reportList].Column(2) = 229 Or Me![reportList].Column(2) = 231) Then
A = Pre_dailyinout(a_tmsql)
B = Pre_dailyinoutHeader(a_tmsql)
's_SQL = "SELECT DISTINCTROW ConfirmShipdate, Buyer, Bene, [SC price], [SC QTY], [SC unit], [SC dely-remark], [SC currency], StyleID, [Buyer PO number], [SC buyingTerm], [SC payment applicant], [SC payment period], [SC payment Ref], [PO number], Fty, [SC dely date], [SC payment Beneficiary], BuyerShortName, SCpaymentTerm, DescrptionShort, [SC number] INTO pendingLC ( ConfirmShipdate, Buyer, Bene, [SC price], [SC QTY], [SC unit], [SC dely-remark], [SC currency], StyleID, [Buyer PO number], [SC buyingTerm], [SC payment applicant], [SC payment period], [SC payment Ref], [PO number], Fty, [SC dely date], [SC payment Beneficiary], BuyerShortName, SCpaymentTerm, DescrptionShort, [SC number] ) FROM ordersPendingLCopendingLinkWithCondate9"
temp_reportName = Me![reportList]
DocName = temp_reportName
DoCmd.OpenReport DocName, A_PREVIEW
End If
temp_reportName = Me![reportList]
DocName = temp_reportName
DoCmd.OpenReport DocName, A_PREVIEW, , TEMPSQL
exit_sub:
Exit Sub
click_error:
Resume Next
End Sub
Private Function check_valid() As Integer
a_check_result = True
If (Me!selector1.Visible = True) And (select1 = 2) And (IsNull(Me!selector1Item)) Then
a_check_result = False: GoTo end_check_valid
ElseIf (Me!selector2.Visible = True) And (Me!select2 = 2) And (IsNull(Me!FromDate) Or IsNull(Me!ToDate)) Then
a_check_result = False: GoTo end_check_valid
ElseIf (Me!selector3.Visible = True) And (Me!select3 = 2) And (IsNull(Me!selector3Item)) Then
a_check_result = False: GoTo end_check_valid
ElseIf (Me!selector4.Visible = True) And (Me!select4 = 2) And (IsNull(Me!selector4Item)) Then
a_check_result = False: GoTo end_check_valid
End If
*******
This is the idea, But It is so generic that allow u add any para (As u can see, there is 5 now in my report selection form.)
Let me know if u need help
Mac