If you always want the current date in the date column, if the user
forgets to put it there, you can add a Default property of =Date() to
the column in the table Design. That will work for new records (append
or INSERT INTO statements).
that didn't work, why? I have the default value set to short date too. I
noticed when I look at the table the date field is blank, but new record has
todays date.
grrr!
The Default value can't be set to "short date" that is a formatting
designation.
Remember that the Default will only work on NEW records. Therefore, if
you want the Date() to be entered into any existing records, that don't
have a date in the required column, you'll have to run an UPDATE:
UPDATE table
SET date_column = Date()
WHERE date_column IS NULL
(Substitute your table/column names where appropriate.)
For changes (UPDATEs) to records thru forms you'll have to use the
form's BeforeUpdate event procedure to enter the Date():
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not Me.NewRecord Then
If IsNull(Me!DateColumn) Then Me!DateColumn = Date()
End IF
End Sub
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
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.