Re: Today's date in Access
From: Albert D. Kallal (PleaseNOOOsPAMMkallal_at_msn.com)
Date: 06/20/04
- Next message: SBCordeiro: "Re: help with listview population syntax"
- Previous message: Ricky A.: "help with listview population syntax"
- In reply to: James: "Today's date in Access"
- Next in thread: Steve Schapel: "Re: Today's date in Access"
- Reply: Steve Schapel: "Re: Today's date in Access"
- Reply: anonymous_at_discussions.microsoft.com: "Re: Today's date in Access"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 20 Jun 2004 14:32:44 -0600
If you are talking about the current form, and that table that the form is
bound to, then it takes ONE LINE of code.
me!MyDateField = date()
I don't think oracle, or any other system on the planet is going to be less
then one line of code...since that would mean no code!
It is not clear if mean update the time to the current table, or you wish to
write out a new record to antoher table each time the current record is
modified?
That being the case, you could use the after udate event:
dim strSql as string
strSql = "INSERT INTO tblLog (fk_id, dtStamp) & _
" values (" & me.id & ", #" & formate(date,"mm/dd/yyyy") &
"# )"
currentdb.Execute strSql
The aboove would udpate to a another table, and you could place the above in
the after update event of the form. I could 3 lines max of code, and again,
I don't see oracle, or any other platform being less lines of code.
"James" <anonymous@discussions.microsoft.com> wrote in message
news:1e9b301c45695$a3bd3b20$a301280a@phx.gbl...
> How can I use a form button to insert today's date in a
> table, to leave a transction log?
>
> I have tried putting the current date in a SQL string
> that I run with doCmd in VBA, but if the data type in the
> table is date/time, I get rubbish (31/12/1899, or some
> such). It looks OK if I change the data type in the
> table to string, but I need it to be a date type for
> calculation.
>
> This would be dead easy in Oracle.
>
> Thanks
>
> James
>
>
- Next message: SBCordeiro: "Re: help with listview population syntax"
- Previous message: Ricky A.: "help with listview population syntax"
- In reply to: James: "Today's date in Access"
- Next in thread: Steve Schapel: "Re: Today's date in Access"
- Reply: Steve Schapel: "Re: Today's date in Access"
- Reply: anonymous_at_discussions.microsoft.com: "Re: Today's date in Access"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|