now() problem

  • Thread starter Thread starter Jagstrom
  • Start date Start date
J

Jagstrom

Trying to get TextCallDate on Form to populate CallDate field on Table
when Disposition Field is updated

Any Help??
 
You could provide a bit more detail, but I am going to take a stab at it.
You need to have the CallDate field in TextCallDate's Control Source for it
to update the feild. If you are wanting it to use the current date and time
when a new record is created, put =Now() in the Default Value property of
the text box. One thing to be aware of is that you should only use Now if
you are going to be using the time value; otherwise use Date. Using Now
when you are really only interested in the date will cause incorrect results
in some queries.
 
TextCallDate Control Source = [Call History]![CallDate]
Default value is blank, since all records are created I just want to
time/date stamp them when they are called.
After they are called I enter text into the [disposiiton] field, thats
why I thought [disposition] field before update event
would be the place to invoke now()
 
Private Sub disposition_BeforeUpdate(Cancel As Integer)
YourFormName.CallDate= Now()
End Sub
 
It's still not clear if this is what you want, but if you want the current
date and time to be inserted into the CallDate field everytime you update
the value in the Disposition field then use someting like this in the
After Update event of the Disposition control;

Me![CallDate] = Now()

If you only want the current date and time to be inserted if there is
*not* already a value there then use;

If Nz([CallDate], vbNullString)=vbNullString Then
Me![CallDate] = Now()
End If

As Dave mentioned, if all you really want is the date then use Date()
instead of Now()
 
You get a better answer with a more complete description of what you are
doing. Actually, it should be in the After Update event, not the before
update event, unless there is more you haven't bothered to include.
 

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

Back
Top