"AA Arens" <bartvandongen@gmail.com> wrote in message
news:1150212521.025307.87400@p79g2000cwp.googlegro ups.com...[color=blue]
> A)
> I have a button on my form. By a push, I want to fill present date and
> time in the two rows of the table.
>
> Form Name: Company
> Table Name: Company
> consists Company ID as primary key, and other company related info,
> name, phone number, and Date and Time (all separate rows)
>
> B)
> WHen I push again, or I access the same record on my form again, and
> activate the button, it replaces the ols Date and old Time with the new
> ones, so, it overwrites.
>
> What is the VB code for A and B?
> I guess must be placed in "On Click".
>
> Bart
> Access 2003
>[/color]
First off, don't use "Date" or "Time" for field names as they're reserved
words in Access. For my example I've assumed control names are "txtDate"
and "txtTime" bound to your date and time fields.
Create a command button and out this in its on click event:
Me.txtDate = Date
Me.txtTime = Time()
Me.Refresh
HTH - Keith.
www.keithwilby.com