Create Auto Date in Subform

A

Angus

I'm creating a database with customer information.

In this form there is a subform with "comments" and a date
field the user can enter about any particular customer.

Rather than have the operater enter the date I want this
to auto-enter on every new comment.

Also I would like the auto date on "comments" to update if
the comment is changed.

Can anyone help me with this?

Angus
 
A

Art

Hi Angus,
You might try putting the following into the after
update event of your comments field:
me!txtDateFieldName = Date

The Easy Day
 
G

Guest

Hi Art

I put in the line you suggested into the comments field
but this had no effect.

Thus in the txtcomments on update I wrote:

me!txtDate = Date

Do you know why this would not have worked?

Thanks

Angus
 
J

John Vinson

Hi Art

I put in the line you suggested into the comments field
but this had no effect.

Thus in the txtcomments on update I wrote:

me!txtDate = Date

Do you know why this would not have worked?

Where exactly did you put it?

I think what Art was suggesting is to open the form in design view;
view its Properties; find the BeforeUpdate event property; invoke the
Code Builder; and edit the code to something like

Private Sub Form_BeforeUpdate(Cancel as Integer)
Me!txtDate = Date
End Sub

and was just assuming you'ld fill in the rest, given the one line...
 
J

John Vinson

I apologize to all if I did not use sufficient detail :(

The Easy Day

No problem, Art - sorry if it came across that way! It can be very
difficult to ascertain a poster's level of experience - sometimes I'll
post a lot of detail and find out that the recipient was a bit miffed
at being 'led by the hand' when all they needed was a single detail,
and sometimes (as in your message) the poster hasn't had enough
experience with VBA to know how to apply the advice.
 

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

Top