Control When a new record is added to a subform

  • Thread starter Thread starter avarho
  • Start date Start date
A

avarho

I am using Access 2007 with an XP Operating System.
I have a form with a subform.
The Subform has 6 Fields: NarrativeID (PK), Time, Temp, Weather,
Description, IncidentID (FK).

The purpose of the subform is to keep track of all activity that happens at
a scene. I have the time set to automaticlly enter by using the =Now()
function in the Default Values section in the properties menu. The problem
that I have is that the time will enter automaticlly when a new record is
created, but Access is automaticlly Creating a New Record when I am in the
description field. So by the time I actually go to the new record the time is
incorrect. How do I set the time to appear when I select the New record and
not when the new record is created? Or how can I delay creating a new record
until I want to add one without have to create a button or require anything
complicated to be done (Using the Tab key for example?).

If someone could please help.
 
remove the default value

put the code in the AfterUpdate of the last field that is manually entered....

or if the nature of the user experience is that a 'new record' button would
be appropriate you could put the code here with the OnClick event...

me.Time=Now()

caution; the generic label 'Date' is reserved by Access and should not be
used as a field name...not sure if 'Time' is or is not...you should visit the
reserved words to double check
 
Back
Top