date field has to be updated or each new record

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

Guest

Why would a date field in a form have to be updated for each new record that
is added. When adding projects to my form (I am doing a staffing by week
database) I have a WEEK#1 field that all dates are referenced from. Lets
say that I add 1111 to the form and I already had a project 1112. The next
time I open the form project 1111 will come before project 1112 but the dates
will be blank across the top of my form. This WEEK#1 field is referenced on
several different forms. Right now, I have a macro that updates this field
for all new records. It is cumbersome to keep going back and Updating week#1
for new records. Does anyone have any suggestions?

Thanks in advance,

Merlin
 
A minor point... You should avoid using the "#" in Field Names. (Week#1)
The # is used by Access to proceed date values in queries, so why not just
avoid it to be safe. (try Week1 instead)
I have a macro that updates this field
for all new records.
Would you care to share that with us?

What is the ControlSource of Week1?

Have you tried a Week1 Default Value for entering the date into Week1 on New
records?

Are you saying that when you created 1111 there was a Date in Week1, but
when you returned to 1111 later, the Date was missing?

Get back... with a bit more info, and I would think we can figure it out.
Al Camp
 
Hi, Merlin.

It sounds like you have a Date field in the project detail record source,
therefore, it would have to be entered for each record. You could break this
into two tables:

StaffingPeriod
---------------------
StaffingPeriodID AutoNumber Primary Key
PeriodDate Date/Time

StaffingDetails
--------------------
StaffingDetailID AutoNumber Primary Key
StaffingPeriodID Integer (Foreign Key to StaffingPeriod)
ProjectNumber Integer
Hours Integer or Single
....etc.

Then a subform based on StaffingDetails would go on a main form based on
StaffingPeriod.

Another approach would be to use the Date field's AfterUpdate event to
change the DefaultValue property so that the entered date becomes the default
for subsequent records:

[Week#1].DefaultValue = [Week#1]

Hope that helps.
Sprinks
 
Back
Top