[AccessD] Building criteria with check-box choices

Reuben Cummings reuben at gfconsultants.com
Thu May 4 09:48:39 CDT 2006


You could also loop thru the check boxes and use the tag property for the
PayGroup name.  I just wrote the easy to read version.

I've done this several times, but can't find one right now.  This may not be
exactly right, but it gives you the basic idea of how to perform it in a
loop.

dim ctl as control
dim x as integer
dim strWhere as string

do while x < me.controls.count
	if ctl.type = accheckbox then
		if ctl = -1 then
			strwhere = strwhere & "or tblCurrentInvoice.Paygroup = """ & ctl.tag &
""""
		end if
	end if
x=x+1
loop

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
>







More information about the AccessD mailing list