Getting Criteria from Optionbuttons

G

Guest

How can I have the Criteria of a query = >0 or
[Forms]![frmReports]![OptionGroupPayType]

Thanks Mike
 
J

John Spencer

Do you want records that are equal to or greater than zero or that are equal
to optionGroupPayType? Or do you want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Or are you attempting to apply criteria to two different fields.
PayAmount >= 0 or PayType is equal to OptionGroupPayType

Please try to restate your need since your posting is unclear (at least to
me).

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Thanks John
I want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Thanks again


John Spencer said:
Do you want records that are equal to or greater than zero or that are equal
to optionGroupPayType? Or do you want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Or are you attempting to apply criteria to two different fields.
PayAmount >= 0 or PayType is equal to OptionGroupPayType

Please try to restate your need since your posting is unclear (at least to
me).

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
How can I have the Criteria of a query = >0 or
[Forms]![frmReports]![OptionGroupPayType]

Thanks Mike
 
J

John Spencer

Still not very clear. Are you applying the >= 0 to one field and the
OptionGroupPayType to another field?

Please describe fully what you are attempting to do. We cannot see your
database.

For instance
IF OptionGroupPayType =1 what do you want to returned? If it is 2 is
something different supposed to happen? If it is null is something else
supposed to be returned?

For instance, the following will return all records where PayType matches
OptionGroupPayType and the Amount is greater than zero AND all records where
the PayType does not match the OptionGroup.

Field: PayType
Criteria(1): [Forms]![frmReports]![OptionGroupPayType]
Criteria (2): <> [Forms]![frmReports]![OptionGroupPayType]

Field: Amount
Criteria(1): >=0
Criteria(2): <<Blank>>
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
Thanks John
I want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Thanks again


John Spencer said:
Do you want records that are equal to or greater than zero or that are
equal
to optionGroupPayType? Or do you want records that are equal to or
greater
than zero unless OptionGroupPayType is some specific value?

Or are you attempting to apply criteria to two different fields.
PayAmount >= 0 or PayType is equal to OptionGroupPayType

Please try to restate your need since your posting is unclear (at least
to
me).

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
How can I have the Criteria of a query = >0 or
[Forms]![frmReports]![OptionGroupPayType]

Thanks Mike
 
G

Guest

Sorry John
I have a field in my query with numeric paytypes value's of
1 = Fulltime
2 = Parttime
I have 3 Optionbuttons in an OptionGroup on my form
Optionbutton1 = 1 Full time
Optionbutton2 = 2 Parttime
Optionbutton3 = 3 Would like to see both fulltime and parttime

John Spencer said:
Still not very clear. Are you applying the >= 0 to one field and the
OptionGroupPayType to another field?

Please describe fully what you are attempting to do. We cannot see your
database.

For instance
IF OptionGroupPayType =1 what do you want to returned? If it is 2 is
something different supposed to happen? If it is null is something else
supposed to be returned?

For instance, the following will return all records where PayType matches
OptionGroupPayType and the Amount is greater than zero AND all records where
the PayType does not match the OptionGroup.

Field: PayType
Criteria(1): [Forms]![frmReports]![OptionGroupPayType]
Criteria (2): <> [Forms]![frmReports]![OptionGroupPayType]

Field: Amount
Criteria(1): >=0
Criteria(2): <<Blank>>
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
Thanks John
I want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Thanks again


John Spencer said:
Do you want records that are equal to or greater than zero or that are
equal
to optionGroupPayType? Or do you want records that are equal to or
greater
than zero unless OptionGroupPayType is some specific value?

Or are you attempting to apply criteria to two different fields.
PayAmount >= 0 or PayType is equal to OptionGroupPayType

Please try to restate your need since your posting is unclear (at least
to
me).

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


How can I have the Criteria of a query = >0 or
[Forms]![frmReports]![OptionGroupPayType]

Thanks Mike
 
J

John Spencer

You can do:
Field: PayType
Criteria: [Forms]![frmReports]![OptionGroupPayType] OR
[Forms]![frmReports]![OptionGroupPayType] = 3

That will be reformatted by Access when you save the query. Access will add
a new column
Field: Expr1: [Forms]![frmReports]![OptionGroupPayType]
Criteria(1): 3
Criteria(2): <<Blank>>

Field: PayType
Criteria(1): <<Blank>>
Criteria(2): [Forms]![frmReports]![OptionGroupPayType]

Or you can handle the situation this way. This way is probably the
cleanest, especially if you have other criteria. Access can do a real mess
in reformatting the above if there are criteria against multiple fields.

Field: PayType
Criteria: Between IIF([Forms]![frmReports]![OptionGroupPayType]=3, 1,
[Forms]![frmReports]![OptionGroupPayType]) and
[Forms]![frmReports]![OptionGroupPayType]

So if the
-- option group is 1, the criteria is between 1 and 1
-- option group is 2, the criteria is between 2 and 2
-- option group is 3, the criteria is between 1 and 3

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
Sorry John
I have a field in my query with numeric paytypes value's of
1 = Fulltime
2 = Parttime
I have 3 Optionbuttons in an OptionGroup on my form
Optionbutton1 = 1 Full time
Optionbutton2 = 2 Parttime
Optionbutton3 = 3 Would like to see both fulltime and parttime

John Spencer said:
Still not very clear. Are you applying the >= 0 to one field and the
OptionGroupPayType to another field?

Please describe fully what you are attempting to do. We cannot see your
database.

For instance
IF OptionGroupPayType =1 what do you want to returned? If it is 2 is
something different supposed to happen? If it is null is something else
supposed to be returned?

For instance, the following will return all records where PayType matches
OptionGroupPayType and the Amount is greater than zero AND all records
where
the PayType does not match the OptionGroup.

Field: PayType
Criteria(1): [Forms]![frmReports]![OptionGroupPayType]
Criteria (2): <> [Forms]![frmReports]![OptionGroupPayType]

Field: Amount
Criteria(1): >=0
Criteria(2): <<Blank>>
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
Thanks John
I want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Thanks again


:

Do you want records that are equal to or greater than zero or that are
equal
to optionGroupPayType? Or do you want records that are equal to or
greater
than zero unless OptionGroupPayType is some specific value?

Or are you attempting to apply criteria to two different fields.
PayAmount >= 0 or PayType is equal to OptionGroupPayType

Please try to restate your need since your posting is unclear (at
least
to
me).

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


How can I have the Criteria of a query = >0 or
[Forms]![frmReports]![OptionGroupPayType]

Thanks Mike
 
G

Guest

Sweet works great. Sorry for not explaining my question clearly the first time
Thanks so much
Thanks Mike

John Spencer said:
You can do:
Field: PayType
Criteria: [Forms]![frmReports]![OptionGroupPayType] OR
[Forms]![frmReports]![OptionGroupPayType] = 3

That will be reformatted by Access when you save the query. Access will add
a new column
Field: Expr1: [Forms]![frmReports]![OptionGroupPayType]
Criteria(1): 3
Criteria(2): <<Blank>>

Field: PayType
Criteria(1): <<Blank>>
Criteria(2): [Forms]![frmReports]![OptionGroupPayType]

Or you can handle the situation this way. This way is probably the
cleanest, especially if you have other criteria. Access can do a real mess
in reformatting the above if there are criteria against multiple fields.

Field: PayType
Criteria: Between IIF([Forms]![frmReports]![OptionGroupPayType]=3, 1,
[Forms]![frmReports]![OptionGroupPayType]) and
[Forms]![frmReports]![OptionGroupPayType]

So if the
-- option group is 1, the criteria is between 1 and 1
-- option group is 2, the criteria is between 2 and 2
-- option group is 3, the criteria is between 1 and 3

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Mike said:
Sorry John
I have a field in my query with numeric paytypes value's of
1 = Fulltime
2 = Parttime
I have 3 Optionbuttons in an OptionGroup on my form
Optionbutton1 = 1 Full time
Optionbutton2 = 2 Parttime
Optionbutton3 = 3 Would like to see both fulltime and parttime

John Spencer said:
Still not very clear. Are you applying the >= 0 to one field and the
OptionGroupPayType to another field?

Please describe fully what you are attempting to do. We cannot see your
database.

For instance
IF OptionGroupPayType =1 what do you want to returned? If it is 2 is
something different supposed to happen? If it is null is something else
supposed to be returned?

For instance, the following will return all records where PayType matches
OptionGroupPayType and the Amount is greater than zero AND all records
where
the PayType does not match the OptionGroup.

Field: PayType
Criteria(1): [Forms]![frmReports]![OptionGroupPayType]
Criteria (2): <> [Forms]![frmReports]![OptionGroupPayType]

Field: Amount
Criteria(1): >=0
Criteria(2): <<Blank>>
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Thanks John
I want records that are equal to or greater
than zero unless OptionGroupPayType is some specific value?

Thanks again


:

Do you want records that are equal to or greater than zero or that are
equal
to optionGroupPayType? Or do you want records that are equal to or
greater
than zero unless OptionGroupPayType is some specific value?

Or are you attempting to apply criteria to two different fields.
PayAmount >= 0 or PayType is equal to OptionGroupPayType

Please try to restate your need since your posting is unclear (at
least
to
me).

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


How can I have the Criteria of a query = >0 or
[Forms]![frmReports]![OptionGroupPayType]

Thanks Mike
 

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