dbTalk Databases Forums  

determine fields of query based on form checkbox

comp.databases.ms-access comp.databases.ms-access


Discuss determine fields of query based on form checkbox in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matthew
 
Posts: n/a

Default determine fields of query based on form checkbox - 11-29-2004 , 01:15 PM






Hey,

I have built a form that has certain combo and text boxes on it, which
a user specifies his criteria and then clicks on a search button to
run a query based on that criteria. To build to this, I want to add
check boxes on this form, with the names of some of the fields in my
query, where if unchecked, the query will still run like before, but
will not show the unchecked fields anymore.
Can I do this?

For example....

- If my query has ID/name/city/state/zip fields
- On the form, I enter ID = 1 but uncheck the city and state boxes
- The query will then show all records with ID = 1, but the city and
state columns will not be shown.

Any Ideas????

Thanks,

Matt

Reply With Quote
  #2  
Old   
Larry Linson
 
Posts: n/a

Default Re: determine fields of query based on form checkbox - 11-30-2004 , 11:08 PM






"Matthew" wrote

Quote:
... To build to this, I want to add
check boxes on this form, with the
names of some of the fields in my
query, where if unchecked, the query
will still run like before, but will not
show the unchecked fields anymore.
Can I do this?
Yes, you can.

You will use VBA code to examine the user's entries and either construct or
modify an SQL statement (that's what a query is -- the Query Builder is just
a visual front end for easily constructing SQL). Without using code, I don't
think you can do what you want.

Larry Linson
Microsoft Access MVP




Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.