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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Put 2 Where Conditions together?



 
 
Thread Tools Display Modes
  #1  
Old June 9th, 2009, 09:17 PM posted to microsoft.public.access
Jo
external usenet poster
 
Posts: 508
Default Put 2 Where Conditions together?

Can I put two Where Conditions in a macro together? If yes how?

Condition1: List Box
=IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

Condition 2: Check Box
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False

First condtiion is for a list box where the user can select a Dept
2nd condition is if the user also select the check box.
I have these conditions in a group macro for a Print Option Dialog. but I
cannot seem to put the condition as one so that the macro reads both
conditions?
Does any one know how I can put the two conditions together please???

  #2  
Old June 9th, 2009, 10:28 PM posted to microsoft.public.access
Steve Schapel
external usenet poster
 
Posts: 1,422
Default Put 2 Where Conditions together?

Jo,

Are you abel to give some more relevant information about what you are doing
please?

What are the Actions in the macro?

Are you talking about a Condition for the macro action(s) itself, or are you
talking about the Where Condition argument of an OpenFrom or OpenReport
action? (Either way, the syntax of the expressions you have given are
irregular.)

Anyway, at this stage it is unclear what you are trying to achieve, so some
more info please.

--
Steve Schapel, Microsoft Access MVP


"jo" wrote in message
news
Can I put two Where Conditions in a macro together? If yes how?

Condition1: List Box
=IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

Condition 2: Check Box
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False

First condtiion is for a list box where the user can select a Dept
2nd condition is if the user also select the check box.
I have these conditions in a group macro for a Print Option Dialog. but I
cannot seem to put the condition as one so that the macro reads both
conditions?
Does any one know how I can put the two conditions together please???




__________ Information from ESET Smart Security, version of virus signature database 4142 (20090609) __________

The message was checked by ESET Smart Security.

http://www.eset.com



  #3  
Old June 10th, 2009, 06:28 AM posted to microsoft.public.access
Jo
external usenet poster
 
Posts: 508
Default Put 2 Where Conditions together?

ok Steve shall try
Macro is attached to a Print dialog form which has a 2 options, Option 1
selects "All Depts" and Option 2 selects "By Dept". And a Check box has now
been added for "Inactive" gauges, the user can now select this check box.
Then user can select Print Preview Or Print Or Close.

1st Option to select All Depts.

Macro Name: Print Preview
Condition: [Report to Print]=1
Action: OpenReport
Where Condition: IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False)
This works perfect!

2nd Option to "Select Dept".

Macro Name: Print Preview
Condition: [Report to Print] =2
Action: OpenReport
Where Condition: =IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

This condition is to select the Dept chosen by the user, my problem is how
to get the conditon to ALSO do the same conditon that is in option 1???
thanks Jo
"Steve Schapel" wrote:

Jo,

Are you abel to give some more relevant information about what you are doing
please?

What are the Actions in the macro?

Are you talking about a Condition for the macro action(s) itself, or are you
talking about the Where Condition argument of an OpenFrom or OpenReport
action? (Either way, the syntax of the expressions you have given are
irregular.)

Anyway, at this stage it is unclear what you are trying to achieve, so some
more info please.

--
Steve Schapel, Microsoft Access MVP


"jo" wrote in message
news
Can I put two Where Conditions in a macro together? If yes how?

Condition1: List Box
=IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

Condition 2: Check Box
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False

First condtiion is for a list box where the user can select a Dept
2nd condition is if the user also select the check box.
I have these conditions in a group macro for a Print Option Dialog. but I
cannot seem to put the condition as one so that the macro reads both
conditions?
Does any one know how I can put the two conditions together please???




__________ Information from ESET Smart Security, version of virus signature database 4142 (20090609) __________

The message was checked by ESET Smart Security.

http://www.eset.com




  #4  
Old June 10th, 2009, 06:56 AM posted to microsoft.public.access
Steve Schapel
external usenet poster
 
Posts: 1,422
Default Put 2 Where Conditions together?

Jo,

I would recommend that you use the Criteria of the query that the report is
based on to achieve this purpose, rather than the Where Condition argument
of the OpenReport macro action. Is there any reason why not?

--
Steve Schapel, Microsoft Access MVP


"jo" wrote in message
...
ok Steve shall try
Macro is attached to a Print dialog form which has a 2 options, Option 1
selects "All Depts" and Option 2 selects "By Dept". And a Check box has
now
been added for "Inactive" gauges, the user can now select this check box.
Then user can select Print Preview Or Print Or Close.

1st Option to select All Depts.

Macro Name: Print Preview
Condition: [Report to Print]=1
Action: OpenReport
Where Condition: IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False)
This works perfect!

2nd Option to "Select Dept".

Macro Name: Print Preview
Condition: [Report to Print] =2
Action: OpenReport
Where Condition: =IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

This condition is to select the Dept chosen by the user, my problem is how
to get the conditon to ALSO do the same conditon that is in option 1???
thanks Jo




__________ Information from ESET Smart Security, version of virus signature database 4142 (20090609) __________

The message was checked by ESET Smart Security.

http://www.eset.com



  #5  
Old June 10th, 2009, 08:23 AM posted to microsoft.public.access
Jo
external usenet poster
 
Posts: 508
Default Put 2 Where Conditions together?

Hi Steve I tried to use the Criteria of the query using:
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False)
But the problem is when I dont select "Not Active" i get no records at all
when I should get some?? and when I select "Not Active" I get everything like
its not actually working??

"Steve Schapel" wrote:

Jo,

I would recommend that you use the Criteria of the query that the report is
based on to achieve this purpose, rather than the Where Condition argument
of the OpenReport macro action. Is there any reason why not?

--
Steve Schapel, Microsoft Access MVP


"jo" wrote in message
...
ok Steve shall try
Macro is attached to a Print dialog form which has a 2 options, Option 1
selects "All Depts" and Option 2 selects "By Dept". And a Check box has
now
been added for "Inactive" gauges, the user can now select this check box.
Then user can select Print Preview Or Print Or Close.

1st Option to select All Depts.

Macro Name: Print Preview
Condition: [Report to Print]=1
Action: OpenReport
Where Condition: IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False)
This works perfect!

2nd Option to "Select Dept".

Macro Name: Print Preview
Condition: [Report to Print] =2
Action: OpenReport
Where Condition: =IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

This condition is to select the Dept chosen by the user, my problem is how
to get the conditon to ALSO do the same conditon that is in option 1???
thanks Jo




__________ Information from ESET Smart Security, version of virus signature database 4142 (20090609) __________

The message was checked by ESET Smart Security.

http://www.eset.com




  #6  
Old June 10th, 2009, 09:14 AM posted to microsoft.public.access
Steve Schapel
external usenet poster
 
Posts: 1,422
Default Put 2 Where Conditions together?

Jo,

Try just putting this in the Criteria of the NotInUse field in the query:
[Forms]![Print Gauge List Dialog]![Not Active]

--
Steve Schapel, Microsoft Access MVP


"jo" wrote in message
...
Hi Steve I tried to use the Criteria of the query using:
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False)
But the problem is when I dont select "Not Active" i get no records at all
when I should get some?? and when I select "Not Active" I get everything
like
its not actually working??




__________ Information from ESET Smart Security, version of virus signature database 4142 (20090609) __________

The message was checked by ESET Smart Security.

http://www.eset.com



  #7  
Old June 10th, 2009, 09:02 PM posted to microsoft.public.access
Jo
external usenet poster
 
Posts: 508
Default Put 2 Where Conditions together?

Hi Steve I done as you suggested but when I check the box it will show me
what is Not Active but when I dont check the box so that it will shows me
Active I get a blank report??? Sorry to be a pain but I have tried various
ways and will either work for one and not the other???
Help please
Jo

"Steve Schapel" wrote:

Jo,

Try just putting this in the Criteria of the NotInUse field in the query:
[Forms]![Print Gauge List Dialog]![Not Active]

--
Steve Schapel, Microsoft Access MVP


"jo" wrote in message
...
Hi Steve I tried to use the Criteria of the query using:
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False)
But the problem is when I dont select "Not Active" i get no records at all
when I should get some?? and when I select "Not Active" I get everything
like
its not actually working??




__________ Information from ESET Smart Security, version of virus signature database 4142 (20090609) __________

The message was checked by ESET Smart Security.

http://www.eset.com




  #8  
Old June 10th, 2009, 09:56 PM posted to microsoft.public.access
Jo
external usenet poster
 
Posts: 508
Default Put 2 Where Conditions together?

Hi Steve I thought I would let know I have managed to get to work using the
following: I
If([Forms]![Print Gauge List Dialog]![Not Active]=True,True,False)
Thanks for you help
Jo

"jo" wrote:

Can I put two Where Conditions in a macro together? If yes how?

Condition1: List Box
=IIf([Forms]![Print Gauge List Dialog]![Select Dept] Is
Null,"","[Department]=Forms![Print Gauge List Dialog]![Select Dept]")

Condition 2: Check Box
IIf([Forms]![Print Gauge List Dialog]![Not
Active]=True,[GaugeInfo]![NotInUse]=True,[GaugeInfo]![NotInUse]=False

First condtiion is for a list box where the user can select a Dept
2nd condition is if the user also select the check box.
I have these conditions in a group macro for a Print Option Dialog. but I
cannot seem to put the condition as one so that the macro reads both
conditions?
Does any one know how I can put the two conditions together please???

 




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 01:45 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.