A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

form1 OR form2 parmeter box problem



 
 
Thread Tools Display Modes
  #1  
Old November 21st, 2006, 09:30 PM posted to microsoft.public.access.reports,microsoft.public.access.queries
Lez
external usenet poster
 
Posts: 3
Default form1 OR form2 parmeter box problem

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


  #2  
Old November 21st, 2006, 09:47 PM posted to microsoft.public.access.queries,microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default form1 OR form2 parmeter box problem

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


"Lez" wrote:

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



  #3  
Old November 21st, 2006, 10:12 PM posted to microsoft.public.access.queries,microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default form1 OR form2 parmeter box problem

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

--
Duane Hookom
Microsoft Access MVP


"Lez" wrote:

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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.