Discussion Locked

Help with Simple VB/Macro In Access 200

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are tyring to use Access 2000 to create some custom reports that read DBF files. We have built the queries that we need linking the various files together. We have also built the report that we need.

What we are stuck on is creating a simpleVB program or a macro that will ask the user to input a STARTING DATE and ENDING DATE, apply those as the criteria to our querrie, and then launch our report.

Any help would be greatly appreciated.

4 replies

by donq

You have 99% of what you need completed!!!

1) Open (or create) a single query that produces everything needed in the report. Include the you are mention in your question. Press the exclamation mark to run the query and verify it produces all required fields with all the dates. Return to Design View.
2) Find the Criteria field under the column heading in your query and enter the following EXACTLY as shown below"

Between [Enter a Start Date] And [Enter a Stop Date]

Press the exclamation mark again and verify the query prompts the user for ehr start and stop dated AND the query produces only the records you asked for.

Save your query and verify the report's data source is the query name so the qquery runs every time the report is requested.

by donq

Excuse the typo's - but I hope you understand

Between [Enter a Start Date] And [Enter a Stop Date]

causes Access to prompt the user for whatever is typed within the square braces and then uses those values as a filter. You might also make sure the query column's Data Type is set to Short Date (or whatever Date Format you use)

This discussion is closed to new replies.