Re: How? Linking a select all box to a query field criteria line
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Mon, 23 May 2005 21:10:58 -0400
No, you can't use an Iif statement like that, nor is Between
[Forms]![Frm_Idata]![Beg Inst ID] And [Forms]![Frm_Idata]![End Inst ID]) Is
Null valid.
Assuming that checkbox is on your form, you could use something like the
following for your where clause:
WHERE (My Id Between [Forms]![Frm_Idata]![Beg Inst ID] And
[Forms]![Frm_Idata]![End Inst ID])
OR ([Forms]![Frm_Idata]![MyCheckBox] = True)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Terri" <Terri@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:58361BB2-31DE-4F98-AF2D-EEED77DA9E17@xxxxxxxxxxxxxxxx
> Can you tell me how to do this using a select query?
>
> Would an if/then statement work such as,
>
> IIf((Between [Forms]![Frm_Idata]![Beg Inst ID] And
> [Forms]![Frm_Idata]![End
> Inst ID]) Is Null, ????????? ,Between [Forms]![Frm_Idata]![Beg Inst
> ID]
> And [Forms]![Frm_Idata]![End Inst ID])
>
> I need help!
>
> Thank you.
>
>
>
>
>
> --
> Terri
>
>
> "David Lloyd" wrote:
>
>> I am not certain of exactly how you are coding this so I am just showing
>> a
>> simple example.
>>
>> Dim sSQL as String
>> Dim sWhere as String
>>
>> sSQL = "SELECT * FROM MyTable "
>>
>> If myCheckBox.Value = False Then
>> 'Define sWhere Clause Here
>> sSQL = sSQL & sWhere
>> End If
>>
>> 'Execute sSQL Here
>>
>> --
>> David Lloyd
>> MCSD .NET
>> http://LemingtonConsulting.com
>>
>> This response is supplied "as is" without any representations or
>> warranties.
>>
>>
>> "Terri" <Terri@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:AC7C7A34-DA98-40C0-A281-DECA298B884F@xxxxxxxxxxxxxxxx
>> Hi,
>>
>> I am working on a database where I have a form that a user can either use
>> combox box range or select the check box to "select all". From the form,
>> I
>> am linking the combo box range to the criteria line of my query. The
>> query
>> will pick up the selection range from the combo boxes if it doesn't have
>> the
>> check box selected. However, if the check box is selected (which greys
>> out
>> the combo boxes), the query won't pick up my parameter selection of
>> select
>> all.
>>
>> How do I get the query to run regardless of whether the user uses the
>> combo
>> boxes or checks the check box to select all?
>>
>> Help! Thank you.
>> --
>> Terri
>>
>>
>>
.
- References:
- Prev by Date: Re: How? Linking a select all box to a query field criteria line
- Next by Date: Naming Queries
- Previous by thread: Re: How? Linking a select all box to a query field criteria line
- Next by thread: Re: How? Linking a select all box to a query field criteria line
- Index(es):
Relevant Pages
|