Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a form to set my query criteria... why isn't it working? 1

Status
Not open for further replies.

ACSeval

Technical User
Joined
Jul 22, 2003
Messages
9
Location
US
Hi all. I am designing a report that allows the user to choose from a list of really long-winded names as criteria. I was recently informed that a combo box would be helpful, as this would allow a drop down menu, instead of manually entering parameters and opening up room for errors. I've created the combo box (my first one, so I don't know if it's at all correct, and I'm sure I'll need to work out it's bugs later)...

However, now I am confused about how to set this as my criteria. I put a statement in my Query criteria line that looks like this:

[Forms]![Call List Selection Form]![List Name]

...however, when I try testing the query, a dialog box pops up asking me to Enter Parameter Value of that statement. I thought this design would open the form and allow me to choose what I want from the drop down list there. It isn't doing this, it wants me to specify parameter.

Is there something else that needs to be changed?Maybe in properties somewhere? Or, add a statement in my form, etc.?

I've been doing a lot of searching to try to find out, but to no avail. (please recognize that I am not familiar with code builder or SQL or VBA, etc...that's my next challenge) So any extra description of steps would be really helpful.

Thanks for any ideas.
Sean (ACSeval)
 
1) is List Name the name of your combo box?
2) what kind of query? select? crosstab?
3) is your form open?
 
Ah, I'm relatively new at this. Sorry for the lack of info.

1. List Name is the variable I wish to set as the criteria. It is also the name of the combo box, from what I can tell.

It is what should be chosen from the form (or, what might be set manually in the criteria statement if the report were to be less dynamic).

2. It is a Select Query, which is opened when the report is run. (the report links to the query, the query is designed to pull the info we need)

3. By open, I imagine you mean an open window? The query doesn't seem to link to it, open or closed. If you mean some other property of which I am unaware, please let me know. (sorry for any ignorance you perceive. I'm great in Excel, and new to Access)

To get a better understanding of where I began, you can check out my previous post.
thread181-610226
 
ok, do this:
look at the design of your form. if the PROPERTIES window is not already visible, choose VIEW+PROPERTIES from the menu. click once on the combo box. click tab ALL. the first property is the name of the combo box. what is it?

dumb question: does your combo box perform as you intend? when you click on it in FORM VIEW, does the proper list of items appear in it?

are you launching the report from the form? what i mean is have you put a button on the form that when clicked, opens the report? if not, this is what you should do. from the TOOLBOX choose BUTTON. put it on the form and follow the Wizard to open your report.

the way this has to work is that you have the form open (not in design mode, but in FORM VIEW). choose something from the drop-down box. click the button. the report opens using whatever was chosen in the combo box. in order for that to happen properly, the correct reference must be made. in the criteria of your query that the report is based on, you must cite the combo box name exactly as it is on the form:

Forms!FormName!ComboBoxName

have you done all of these steps? if so and it still doesn't work, you can compact and send to me at rowe147@hotmail.com and i will look.
 
Ginger, you rock. Thanks for setting me on the right path. I knew I was close, but there have been certain little things of which I was unaware. I've got the program working now, doing the things I need it to, and I am grateful for your help.
 
glad to help. keep plugging away...

have fun--g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top