Auto-Populating Date

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

Guest

I have a database for postage logs at my job. I have over 60 areas that I
have to enter postage on for. I typically enter the information at the end
of the month, but have information for every day that I need to enter.
Rather than having to enter the date for each area, every day, I would like
to run a query (or some code) that will automatically fill in the dates for
each area. I am thinking of a menu option that would set up the month.
I figure that this would be accomplished with an append query but am at a
loss as to how to go about it.
Any suggestions?
 
Dear Steve:

I assume you have a form that does this. You could put a date control on
the form to select the current posting date. Don't bind this control. It
would then NOT change as you scroll though existing rows (you should have
another, bound control that shows the posted date of the currently displayed
row). In the Before Insert event of the form, update the applicable column
from this control. Wallah!!

This "default date" control could be set to the current date when the form
opens. Alternatively, you might want to have the control be "persistent,"
that is, return to the value last used. You may want this "last used" to be
a system wide parameter, or it could be a value associated with each user.
For purposes like this, I maintain two tables. One table is for system-wide
persistent values. Each such value is named in this table. The other is
for "per user" persistent values, keyed by a user name or ID, as well as by
the name of the value being stored. Not a simple thing, but not a really
big one either.

Tom Ellison
 
That would work good if I was entering the data on a daily basis. However, I
enter the data once per month, on the last day of the month. I would think
that there would be a way to create the records with 1 record for each day of
the month. I would have it set as a menu item or simply a button that could
be clicked and it would create all the dates. For example, if I clicked the
button on 12/31/05, it would create 1 record for each day, under each
"property", starting with 12/01/05 and end with 12/31/05.
 
Dear Steve:

I hope I'm understanding this correctly.

It would not be difficult to set up the date control to advance one day
every time a new row has been entered. You could also easily have a control
(command button) on the form that advances the date by one day. Do it any
way that seems to be most natural to what you want done, and what will
expedite data entry.

Tom Ellison
 
Back
Top