Report Based On Custom Dialog Box

ccocom

Registered User.
Local time
Today, 12:35
Joined
Nov 15, 2002
Messages
27
I want a custom dialog box with a combo box to appear when I open a form.

I have browsed the forum and tried the following solution to no avail:

Add a combo box to your form then lookup the table that your drop down list is stored in. You can then open your report based on the selection you make.

In the query you would add criteria to look to the combo box for an entry

[forms]![yourformname]![yourcomboboxname]

After doing this, when I opened the report, I get the standard dialog box, asking to enter forms!yourformname!yourcomboboxname. The custom form I created doesn't seem to be linked.

Any ideas?
 
?? How are you opening your report ??

The form that you have placed your combobox on is not actually "linked" to the report. You will have to open the form first, and then select your combo box option, then open the report.

This can obviously be streamlined by use of code on the "after update" event of the combo to open the report, or use a command button on the form etc. (if you use a command button, make sure you check to see if the user has selected a combo box option first or you will return a blank report).

HTH

Brad.
 
Brad:

The form pops up when I open the report (or I want it to anyway). I can enter data in it, but the data doesn't make its way to the query. How should I proceed.
 
Your criteria form should be open before activating your report.

If this is the case, and you open your report, and still get the forms!yourformname!yourcomboboxname prompt, then I would suggest checking your comboboxname etc.


General process overview:

Report based on query
Query uses forms!yourformname!boxname - etc as criteria

How to open report:
Switchboard etc to open form "yourformname" for criteria selection
Action on form "yourformname" opens report.

HTH

Brad.
 
Thanks, Brad. I wasn't getting that the report had to be opened from the previously opened lookup form. Now on to the next problem: I am unable to use a custom parameter form to open a different form showing the selected data from the custom parameter form. Any ideas?
 
Use the WhereCondition of the OpenForm Function

ie:

DoCmd.OpenForm Your2ndFormname, , ,WhereCondition

The WhereCondition should be structured as:

"[FieldOn2ndForm] =" & me.[FieldOn1stForm] - Ensure that the data types are the same!

Overall:

DoCmd.OpenForm Your2ndFormname, , ,"[FieldOn2ndForm] =" & me.[FieldOn1stForm]

HTH

Brad
 

Users who are viewing this thread

Back
Top Bottom