Date refreshing AfterUpdate of different field

wizz_darlo

Registered User.
Local time
Today, 01:38
Joined
Aug 1, 2005
Messages
16
Hi all.

Benn looking through other posts and have found some things which look quite similar but nothing which answers the question simply enough for my standard!

Basically I have a form with 5 fields...Number, Name, Location, Date and Owner.
All fields are locked apart from Location and Date.
I have a combo box which lists the field "Number" and then displays the record's data. The aim of the form is to be able to update the Location field easily.
A user entering the form would use the combo box to select say number "3243". This would bring up record number 3243. The date displayed would be the last updated date. Currently 23/08/05. I am trying desperately to get the Date to refresh to the current date as soon as someone changes the "Location" field. I have tried putting in the AfterUpdate part of Location...Me.Date.Requery.

I feel that I may be well off track but that the answer I require is not too difficult. Please could someone advise?!?!

TIA.

--Update--
Think I've sorted it now everyone!!
My code looks like this, seems to do the trick.

Code:
Private Sub Combo15_AfterUpdate()
Me.Date = Format(Now(), "dd/mm/yy")
End Sub

I guess I should learn to try my hardest before posting here!! :)
 
Last edited:
Hey TIA,

Just an FYI. If you truly have a field named 'Name' and a field named 'Date', then you could encounted problems later since these are reserved names in Access.

Just trying to help,
Shane
 
Why use the Now() function and format it to not show the time of day? If you don't want time stored, use the Date() function.

Me.YourDateField = Date()

If you have trouble in VBA with a field whose name is that of a function or property, the problem is likely caused because you have confused VBA. Change your column name and avoid the names of functions or properties in the future.
 

Users who are viewing this thread

Back
Top Bottom