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

How to make a form create a report?

100+
P: 283
Im having trouble trying to get a report to pull based on selections you make from 3 combo boxes.

What I have are 3 combo boxes city, state, and zip code. What im trying to do is make is so you can select either one, two, or all three combo boxes and then press a button that will create a report showing the city state and zip along with an id number that is on the back end. I have been trying to get a query to run everything once you press the button but keep getting blank records. In the criteria of the query for the city state and zip I have the expression

Expand|Select|Wrap|Line Numbers
  1. [Forms]![FIDLookUp]![cboCombo0]
  2. [Forms]![FIDLookUp]![cboCombo2]
  3. [Forms]![FIDLookUp]![cboCombo4]
  4.  
Im not sure what else i need to put in to make it pull the information plus im not sure if I need to tell the command button to do more when you click it.

Also i only need the report to display in a preview mode I dont need to print the report at all.
May 4 '10 #1

✓ answered by NeoPa

Hopefully these links (Example Filtering on a Form & Cascading Combo/List Boxes) will do better than that. They go through the whole concept in some detail, including an example database to play with.

Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,186
The easiest way to handle this is to formulate a filter string, in the format of a SQL WHERE clause, but without the word "WHERE", that includes only those elements that are selected.

With this filter string you can open the report from your form, passing the filter string as the WhereCondition parameter.
May 4 '10 #2

100+
P: 283
@NeoPa
Hi NeoPa,

Thanks for replying. Any chance you could show me an example of what you are talking about? I tried using Where in front of my expressions in the Query, and so far im having no luck and it keeps pulling up blank information. The only way things are working for me is if I dont have the report linked to the form and you press the run report button I have set up and a pop up box opens and asks you to type in the information then it works great. Other than that I cant get the form drop down boxes to work.

thanks again
May 4 '10 #3

NeoPa
Expert Mod 15k+
P: 31,186
Hopefully these links (Example Filtering on a Form & Cascading Combo/List Boxes) will do better than that. They go through the whole concept in some detail, including an example database to play with.
May 5 '10 #4

100+
P: 283
Hi NeoPa,

Thanks for the links. There is a lot of information there really appreciate it.

After looking over the links in more detail and then doing more research i think you might have misunderstood what im trying to do. Its my fault going back and looking at what i wrote.

What im trying to do is create more of a search query based off of a form. So i have 3 combo boxes. What you can do is select a city, state and zip code. Then I have a button to run a query that will look at the table and then based on what city state and zip you typed in will find that record and return the city state zip along with an id number that matches it. I dont need to cascade the boxes or anything like that. I just need to have it you select a city name or state or zip and press query, and it will look through the table and find all the cities, states, and zip that match that criteria and create a list of all the cities states and zip codes based off of what you typed in or selected.

Its seems like it should be real simple to do but for some reason its not.

Hope that is a better explanation
May 5 '10 #5

NeoPa
Expert Mod 15k+
P: 31,186
If you look at the first link again you should find that's pretty well what it's talking about. The details will be different of course, but the concept is exactly what you describe.

It handles filtering on Text, Numeric and Date controls. It filters the main form it's on, but the same concept could equally easily be used for filtering a report or any other object based on a dataset.
May 5 '10 #6

Post your reply

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