Date Stamp

A

AlCamp

Randy,
Add two fields to your table for the form.
DOC (short for Date Of Creation) and
DOLE (short for Date Of Last Edit)

In the BeforeUpdate event for the form...

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull([DOC]) Then
DOC = Now()
Else
DOLE = Now()
End If
End Sub

This will tell you when the record was created, and when it was last edited.
hth
Al Camp
 
R

Randy

Thanks Al for the info...I will play with this....What I was actually going
for, which I apologize as I should have been more specific, is I have a
checkbox that I need to, when checked, insert the current date. I got the
check box to do this, however as long as the checkbox is checked everytime I
open the form it changes the date to the current date. I need the date to
remain the original date (stamped) as to when the checkbox was originally
checked rather than changing to the currect date. Not sure if this helps but
if you have any questions please let me know...

Thanks for all your help...

Randy

AlCamp said:
Randy,
Add two fields to your table for the form.
DOC (short for Date Of Creation) and
DOLE (short for Date Of Last Edit)

In the BeforeUpdate event for the form...

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull([DOC]) Then
DOC = Now()
Else
DOLE = Now()
End If
End Sub

This will tell you when the record was created, and when it was last edited.
hth
Al Camp
 
S

Steve Schapel

Randy

To solve this problem will require to know "how" the date is being
allocated, and which event(s) are involved. But it occurs to me that
this date stamp may be set up as an unbound control on your form,
whereas if you want the originally assigned value to be retained, you
will need a field in the table that the form is based on and for the
control on the form to be bound to this field.
 
R

Randy

Thanks Steve....I figured it out! I created a macro that works for my
needs....If you get a chance take a look at my other posting "Dates".....I
really need help with that one!!
Thanks for all your help!!
Randy
 
R

Randy

Thanks for your help....I figured out a macro that helps with this one...I do
need some assistance with another posting "Dates" if you think you might be
able to help with that one...

Thanks again for your assistance...
Randy

AlCamp said:
Randy,
Add two fields to your table for the form.
DOC (short for Date Of Creation) and
DOLE (short for Date Of Last Edit)

In the BeforeUpdate event for the form...

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull([DOC]) Then
DOC = Now()
Else
DOLE = Now()
End If
End Sub

This will tell you when the record was created, and when it was last edited.
hth
Al Camp
 
R

Randy

Sure.....What I did was created a macro with conditions:
(1) Condition: [CheckBox]=Yes Action: SetValue
Item: [Date Field]
Expression: Date()
(2) Condition: [CheckBox]=No Action: SetValue
Item: [Date Field]
Expression: Null
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top