[AccessD] Building criteria with check-box choices

Gould, Nanette nanette.j.gould at Vanderbilt.Edu
Thu May 4 10:02:39 CDT 2006


Thank you, Reuben. I think I understand this solution better than your
other one so I'll try this one first. I really appreciate the help. 


Thanks,
Nanette

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Reuben
Cummings
Sent: Thursday, May 04, 2006 9:39 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Building criteria with check-box choices

I assume you mean each check box specifies a pay group

Can you just check each box for yes/no and write to the "where"
accordingly.

If chk1 = -1 then
	strWhere = strwhere & "or tblCurrentInvoice.PayGroup = AAA"
end if
if chk2 = -1 then
	strWhere = strwhere & "or tblCurrentInvoice.PayGroup = BBB"
end if
if chk3 = -1 then
	strWhere = strwhere & "or tblCurrentInvoice.PayGroup = CCC"
end if

You end up with a criteria string.  Strip off the first "or " and append
it to your SQL.

Reuben Cummings
GFC, LLC
812.523.1017


> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gould, 
> Nanette
> Sent: Thursday, May 04, 2006 10:16 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Building criteria with check-box choices
>
>
> I've got a problem that seems like it should be easy but I can't get 
> it right. I have an unbound form that allows the user to choose any 
> number of PayGroups (12 total) and the exported Excel file uses those 
> choices as criteria to pull from the PayGroup field from 
> tblCurrentInvoice. The PayGroup is a 3-character text field. They also

> choose a PayPeriodEndDate from a calendar. Those two choices 
> constitute the only criteria for running the export. Can someone help 
> me extract the values of the checked boxes and make those the criteria
for my export?
>
> Thanks!
>
>
> Nanette
>
>
>
> Nanette Gould | Dept of Finance | Crystal Terrace | 3319 West End Ave,

> Ste. 700 | 615.322.3540 | nanette.gould at vanderbilt.edu 
> <mailto:nanette.gould at vanderbilt.edu>
>
>
>
> The information transmitted with any attachments is intended solely 
> for the individual or entity to which it is addressed and may contain 
> confidential and/or privileged material.  If you have received this 
> email in error, please contact the sender and delete the material from

> your system.
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list