Conditions and Databases

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

Guest

Hi everyone. Ignorant newbie question here

What I want to do is to fill a table - called date_table (only one relevant field: report_date) with an entry for every day of the year. This has to be done by my client, who knows nothing at all about computers, so I thought I'd give her a nice user friendly button to do this

My original thought was to call a select...into query from a macro. This would use a second table with two fields - (table: date_info: fields: current_date and last_date). It would insert the current date into the main table, then increment the current_date, using an update quer

The macro should then check to see whether the current date is equal to the last date. If it is not, then the macro should run again

My problem is that I can't seem to make the condition field refer to fields in the date_info table. I'm begining to suspect that I've gotten hold of the wrong end of the stick here

So, my questions are: (a) is it true that I can't use the value from a field in a macro condition
and (b) can anyone suggest an approach which will work

Thanks for your thoughts..

Alister Pate
 
Alister,

Yes, you can use the value in a field in a macro condition... as long as
you can specify which record! The two methods of specifying which
record are a domain aggregate function, such as DLookup(), or by
reference to the current record on a form.

I'm afraid I haven't quite grasped what you are trying to do here,
especially with reference to the current date. But here's a couple of
ideas that might help...

You could make a macro using the OpenQuery action to run an Append
Query, which will add a record to the date_table table with the date
field of the appended record being:
DMax("[report_date]","date_table")+1
Then, make another macro using the RunMacro action to run this first
macro, and set its Repeat Count argument to 365.

You could make a simple table with one number field, lets call it
DaysSeed, and enter numbers 0 to 364. And you could then make an Append
Query based on this table, with the date on the appended records being:
<Your start date>+[DaysSeed]
This will add all records in one hit with tha Append Query.
 
Back
Top