date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

when I open the form I want to have today date on my date field but just if
it is a new lient not on the previous one that already collect information
about
 
Imarko said:
when I open the form I want to have today date on my date field but just
if
it is a new lient not on the previous one that already collect information
about

Try this in the form's OnCurrent event:

If Me.NewRecord Then
Me.MyDateField = Date
End If

(substitute MyDateField with your date control's name)
 
Imarko said:
when I open the form I want to have today date on my date field but
just if it is a new lient not on the previous one that already
collect information about

Enter Date() as the default value property for that control.
 
Stuart said:
Try this in the form's OnCurrent event:

If Me.NewRecord Then
Me.MyDateField = Date
End If


This is not a good idea because it dirties the new record
before the user enter starts to enter data. Then the user
must undo the record when s/he decides not to create a new
record.

The BeforeInsert event is the earliest safe event that can
be used, but then users can not see the date until data
entry begins.
 
Marshall Barton said:
This is not a good idea because it dirties the new record
before the user enter starts to enter data. Then the user
must undo the record when s/he decides not to create a new
record.

The BeforeInsert event is the earliest safe event that can
be used, but then users can not see the date until data
entry begins.

Right you are. Thanks for the correction.
 
So, Marsh, you're saying that unlike the rest of the Access developing
community, you never use default values?

Rick said:
Enter Date() as the default value property for that control.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
I think your newsreader has mangled this thread.

From where I sit, you replied to Rick after he suggested
using DefaultValue.

Else thread I replied to Stuart why assigning the Value in
the Current event is not a good idea. I assumed it went
without saying that Rick's approach was the preferred
method.

Given my view of this thread, I really don't understand
where your question is coming from.
 
Back
Top