form1 OR form2 parmeter box problem

L

Lez

Hi Guys,

I have a report that I want to use from 2 different forms and have added in
the criteria section:

[Forms].[frm1].[CustID]
or
[Forms].[frm2].[CustID]

The problem is if using either form a parameter box displays, although I can
cancel it I would prefer it to not show, can anyone help me with this please

TIA
 
K

KARL DEWEY

--- UNTESTED ---
Try this as criteria --
IIf([Forms].[frm1].[CustID] Is Null, [Forms].[frm2].[CustID],
[Forms].[frm1].[CustID])
 
D

Duane Hookom

I would remove every possible dynamice criteria from the query. Use the Where
Condition of the DoCmd.OpenReport method to filter your report records.

Dim strWhere as String
strWhere = "1=1 "
If Not IsNull(Me.CustID) Then
strWhere = strWhere & " And [CustID]=" & Me.CustID
End If
DoCmd.OpenReport "rptCustomer..." , AcPreview, , strWhere
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top