By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

User chooses field and value in query

P: 3
How do you set up a query and report so the user can choose the field/s and the value of the field/s.
Thanks
Aug 21 '06 #1
Share this Question
Share on Google+
4 Replies


100+
P: 179
Could you please give more detail as to what it is you are trying to accomplish?

comteck
Aug 22 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
You're talking about dynamic reporting I think. This can actually be fairly complicated. The easiest way to do it is this.

The user can choose from a list of fields in a listbox corresponding to a query or table. You can only have one query or table, otherwise it gets too complicated.

You build a select statement based on the users choices and this is the base for your query.

You can define a query in VBA and allow the user to view it or output it to excel.

Have a look at the following site:

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/web/011.asp

Particularly the section "The QueryDef Object and the QueryDefs Collection."

However, populating an Access Report with this data is not so simple.

You can use the CreateReport method found here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/acmthCreateForm.asp

However, designing a template for this report is not easy and the Access default template is very basic.


How do you set up a query and report so the user can choose the field/s and the value of the field/s.
Thanks
Aug 22 '06 #3

P: 3
Thank you Mmccarthy. That is what I was looking for but it sounds far to complicated so I'll just have to find another way to do it. Thank you for your help.
Aug 23 '06 #4

100+
P: 179
Again, devinsnyman, can "YOU" please provide more detail of what it is you're trying to accomplish. Maybe somebody else has some ideas that can help you.

comteck
Aug 23 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.