Update text box using after update event on another

D

DeVille

I have two text boxes ('LastUpdate' and 'Solution') on my
form 'LastUpdate' is a text box that is to record when
the other text box 'Solution' was last updated.

I would like to attach some code to the AfterUpdate event
procedure on the 'Solution' text box which says to put
the current date in the 'LastUpdate' text box (or the
corresponding field in the table)

The question marks are where I am missing the code. If
anyone can help thanks in advance

Private Sub Solution_AfterUpdate()

DoCmd.?????

End Sub
 
F

fredg

I have two text boxes ('LastUpdate' and 'Solution') on my
form 'LastUpdate' is a text box that is to record when
the other text box 'Solution' was last updated.

I would like to attach some code to the AfterUpdate event
procedure on the 'Solution' text box which says to put
the current date in the 'LastUpdate' text box (or the
corresponding field in the table)

The question marks are where I am missing the code. If
anyone can help thanks in advance

Private Sub Solution_AfterUpdate()

DoCmd.?????

End Sub

No DoCmd needed.
Do you want the current date, or the current date and time?

Private Sub Solution_AfterUpdate()
[LastUpdate] = Date ' Date only
End Sub

or if you want the Date and time, use:
[LastUpdate] = Now


[LastUpdate] should be bound to the [LastUpdate] field in the table.
 

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