Roger Reinsch
Registered User.
- Local time
- Today, 12:40
- Joined
- Sep 3, 2012
- Messages
- 18
I have a subform that I want to print (and export to excel) and it keeps asking me to provide parameters that are already provided on the main form. I'm missing something. Here's what happens.
Please reference "TheForm".
When the main PCLists form is opened the datasheet view area is blank as are the three moss green background parameter fields. When the word "Court" is entered in the bottom moss green box, the datasheet view in the subform is populated as seen in this screen shot.
Please reference "TheQuery".
This shows the design view of the query that is used to populate the datasheet view of the subform. Note that there are two parameters for the query. The two named fields (Pname and Pnumber) are fields on the main PCLists form. In the example shown on "TheForm", PName has been filled in with the text "Court". This satifies the two criteria referencing that field and the query delivers a result.
Please reference "TheSQL".
This is the SQL generated to perform "TheQuery". It looks fine.
Please reference "TheMacro".
This is the logic that run when the "Print This List" button is clicked on the main form. This is setup with the Button Wizard - which generated macro code with no apparent option for VBA.
When the button is clicked, a dialog box opens up to ask the user to enter the Pnumber and Pname parameters - even though both parameters were already resolved in showing the result in the form. I need it to print without asking for the parameters again.
The "Export This List" button has the same kind of problem. I'm obviously missing something.
What I would really like is a VBA statement that looks sort of like
[PCAlphaWithinPrecinct Subform].[print current contents with formatting please]
Any help would be appreciated.
Please reference "TheForm".
When the main PCLists form is opened the datasheet view area is blank as are the three moss green background parameter fields. When the word "Court" is entered in the bottom moss green box, the datasheet view in the subform is populated as seen in this screen shot.
Please reference "TheQuery".
This shows the design view of the query that is used to populate the datasheet view of the subform. Note that there are two parameters for the query. The two named fields (Pname and Pnumber) are fields on the main PCLists form. In the example shown on "TheForm", PName has been filled in with the text "Court". This satifies the two criteria referencing that field and the query delivers a result.
Please reference "TheSQL".
This is the SQL generated to perform "TheQuery". It looks fine.
Please reference "TheMacro".
This is the logic that run when the "Print This List" button is clicked on the main form. This is setup with the Button Wizard - which generated macro code with no apparent option for VBA.
When the button is clicked, a dialog box opens up to ask the user to enter the Pnumber and Pname parameters - even though both parameters were already resolved in showing the result in the form. I need it to print without asking for the parameters again.
The "Export This List" button has the same kind of problem. I'm obviously missing something.
What I would really like is a VBA statement that looks sort of like
[PCAlphaWithinPrecinct Subform].[print current contents with formatting please]
Any help would be appreciated.