|
Prev: Adding Spell Check on Access 97
Next: Subform error
From: Tom on 15 Jan 2006 12:28 I have a control in my form that is "currenttime". This form is open ready for new data to input, however, the time is stopped at the moment I open the form. Is there a way for the time to continue while the form is open and then freeze when the control is either "clicked" or a "button" is pushed, so the correct time is recorded for that data that is entered? Thanks, Tom
From: Steve Schapel on 15 Jan 2006 13:52 Tom, Do you mean you want this field to record the time that the record is completed/saved? It sounds like you have the Default Value of the field set to Time(), am I right? If so, I would remove this, it is not what you want. You can do this... On the Before Update event of the form, put code like this... Me.YourTimestamp = Time However, what this means is that if the record is saved, and then subsequently edited (and thus saved again), the Timestamp field will be updated to the time of the update. If this is not what you want, and just want to retain the time of the first entry of the record, then use code like this... If IsNull(Me.YourTimestamp) Then Me.YourTimestamp = Time End If or... If Me.NewRecord Then Me.YourTimestamp = Time End If -- Steve Schapel, Microsoft Access MVP Tom wrote: > I have a control in my form that is "currenttime". > This form is open ready for new data to input, > however, the time is stopped at the moment > I open the form. > > Is there a way for the time to continue while the > form is open and then freeze when the control is > either "clicked" or a "button" is pushed, so the > correct time is recorded for that data that is > entered? > > Thanks, > Tom
|
Pages: 1 Prev: Adding Spell Check on Access 97 Next: Subform error |