On Tue, 27 Feb 2007 19:19:00 -0800, Meghan M. wrote:
See my comments in-line below....
Fredg- thanks for the quick response. I understand the idea behind your post
and got parts of it to work but I am having trouble with some of the codes.
***Ok here
***MS Access didn't recognize the macro. Can I use a minimize macro here?
I am not sure where to put Me.Visible = False code and what it means (sorry,
codes are new to me!).
I suspect you are trying to write the code I gave you directly on the
property sheet line. That's not where it goes.
Let's use the PaamForm's Command Button click event
Me.Visible = False
as an example.
To write the code, display the ParamForm's Command Button's property
sheet.
Click on the Event tab.
On the Click event line, write:
[Event Procedure]
Then click on the little button with the 3 dots that appears on that
line.
When the VBA code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those lines write
Me.Visible = False
Exit the code window.
Now do the same thing for each of the other code events I mentioned
above using the appropriate event.
Name this form 'ParamForm'.
***Ok here
In each Report's Record Source [CompanyID] field criteria line write:
forms!ParamForm!FindCompany
***Where do I put this code? Do I put it in the Report Record Source and
all of the places Company ID appears? If the table that the report is built
from is called 'Company Information'- do I replace 'Company Information' in
the Report's Record Source with forms!ParamForm!FindCompany or do I put that
code as the source on Company ID properties?
This is not code.
It does not go in the report,
It goes in the query that is used as the record source for the
report.
You must first create a query using your "Company Information" table
as the query's record source.
Here's how.
Click on Queries on the Main Database folder.
Then click on New.
When the new query dialog opens select Design View. Click OK.
Select the name of the table that is to be the record source of the
query "Company Information" ) from the Show Table box. Click Add.
If you need additional tables in the query, add them now.
Then click Close.
Make sure the relationships between each table in the query is
correct.
Drag each field you wish to show in the report from the table box onto
the grid.
Then while still in query design view, on the criteria row of the
CompanyID column write:
forms!ParamForm!FindCompany
Save and name the query.
Make this query the record source for your Report.
Please do not use a Macro. Use the same [Event Procedure] method I
showed you above to write the code in the Report's Open event.
Please do not use a Macro. Use the same [Event Procedure] method I
showed you above to write the code in the Report's Close event.
***Things seems to be running but doesn't recognize the record source and
says to select an existing table or query.
If you have properly done all the above, it will run properly.
Have fun.