Is this possible?

MICHELE

Registered User.
Local time
Today, 14:33
Joined
Jul 6, 2000
Messages
117
I'm sure it is, but I can't figure out how to make it work.
I have a Shipping report from information entered by our Shipping Department. I need to have the Shipping department enter a date or something somewhere that will let everyone know that the report is ready to print.
Then when the report prints, in the Header section I need a field that says either "Final" or "Prelimb" depending on if Shipping is ready for the report to be printed.
I hope this makes sense. I have been experimenting with some some different things but nothing has worked yet.
Any ideas?
 
For starters you're going to need to store the ready-to-print date in a table somewhere. It might be as simple as a table with only one column and one record:

tblShipping
- ReadyToPrintDate

Then on the OnOpen event of the report do something like this:
Code:
Dim ldReadyToPrint as Date
ldReadyToPrint = Dlookup("ReadyToPrintDate", "tblShipping")
If ldReadyToPrint > Date() then...

Bill Norton
Austin, TX
 
If you're using single-row tables to store system variables or flags (I do this all the time and I usually call the table 'system'), I think it's a good idea to add an autonumber field as the primary key (I usually call it 'Instance' for some reason); that way if some meddler adds a second row to the table, your application knows that it's only ever meant to be looking at row 1, so your code would then look like:

Code:
Dim ldReadyToPrint as Date
ldReadyToPrint = Dlookup("ReadyToPrintDate", "system","Instance = 1")
If ldReadyToPrint > Date() then...

I use tables like this to store such things as next export file sequence number, default import and export paths, system name (which I set up to appear on all report headers) etc.

[This message has been edited by Mike Gurman (edited 06-11-2001).]
 
I concur with Mike Gurmans suggestion and use a 'system' table to hold such details as the companies details etc.. to appear at the heading of reports etc.
 
Thanks for all the great advice. The "System" Table is exactly what I did. Then in my query for the report, I joined the 2 tables, added a field that prints either "Prelimb" or "Final" depending on whether our Shipping manager has entered "yes" for a particular date. It works perfectly!
 

Users who are viewing this thread

Back
Top Bottom