Carrying a Date throughout the application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The data imported into Access includes a spreadsheet with monthly figures.
Once the month is select, a crosstab table is created using the month's
financial numbers.

I also need the date in two other locations.
1. For the final Report Heading in the format as "January 31, 2006" and
2. As a field in the History table that appends each month's records.

At one point in the code, I prompt the user for the month as "Jan", or
"Feb", or "Mar" .... then I create the Crosstab table. I also prompt the
user for the report heading date (format: "January 31, 2006" and finally, I
prompt the user for the History table date (any date format would work as
long as it's consistent for each month). HELP ! How can I prompt the user
only one time and carry that date throughout the application. (Using the
function Date () - days or months does not work since the report for January,
February or March can be pulled anytime in the year)
 
SharonInGeorgia wrote:
How can I prompt the user
only one time and carry that date throughout the application. (Using the
function Date () - days or months does not work since the report for January,
February or March can be pulled anytime in the year)

Two simple ways you can handle this:
1) Create a "system" table to store the date entered. Alot of folks use
this kinda table to store things like the company name, address, etc.
It's just a table with a single row, and each field storing the
appropriate value. So after they enter the date format that you want,
you store it on the table, and then retrieve it from the table with a
DLookup on the reports.

2) Create two public procedures in a module. One which accepts the input
of the date as a parameter and stores it in a global variable, and the
second which returns that same value. Then call the retrieve function
when you want to see the date on your report.

I've given you the gist of it, but actual code. Hopefully this will put
in you in the right direction. Holler if you need more.
 
Back
Top