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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Combo Box in a Form in an Access ADP

Status
Not open for further replies.

barbershopper

Technical User
Jun 14, 2006
5
US
I need to make a report more flexible, so that users can get the specific data that they need. The front end is an Access ADP, on a SQL backend.

I want to use combo boxes that use a table for lookup, so the users can make their choices, and I don't have to write a data validation routine.

The form containing the combo boxes, runs an event procedure that opens a report, and the data source for it is a view.

How do I get the view to recognize the combo box values as part of the query?

Time is of the essence, and I would say that I'm a novice at best, when it comes to ADP's and SQL.

Thanks in advance.
 
There may be other ways but here is what I would do...

Make a Stored procedure to select values for your report (an inline user-defined function would work too but I would only bother if doing the same for a form instead of a report). If you want you could select everything from the view.

Next in the criteria column specify parameters. much like you would in the Jet QBE except that parameters begin with the at symbol '@' and do not have square bracketes around them.

Finally on the report's properties, specify input parameters...

@Paramater1 = Forms!Formname!comboBox1, @Parameter2 = Forms!Formname!comboBox2

Note worthy is the fact that just yesterday I was trying to specify input parameters on sub reports and could not indirectly reference the parent form (Me.parent!Field) so I ended up using the whole reports declaration (Reports!Reportname!Control). Not as portable as I would like but functional.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top