updating fields using controls

pl456

Registered User.
Local time
Today, 22:43
Joined
Jan 31, 2008
Messages
150
Anybody got a simple way to do this.

I know you can set the control source of a control to be lets say Now(), but how can I pass this into a date field in the underlying query, the only way I know is to change the control source of the date fields control to refer to the Now() control but then it wouldnt update because it is no longer attached to the date field.
 
Sounds like you need to set the control source of the text box to the date field and set the default value to Date() (instead of now()) ?
 
I have been lookinig at it too long hence the jibberish I wrote.

What I actually want is for the date field control to update when I change another fields value, its a status complete field I will be changing to Yes and I want the date field to auto fill.
 
So the control you are changing needs an AfterUpdate event, in which your date control is set to Now() (or Date(), whichever you need). So you want something like:

Private Sub OtherCtrlName_AfterUpdate()

Me!DateCtrlName = Now()

End Sub

And make sure in the properties box for OtherCtrlName that next to After Update on the Events tab it says [Event procedure].
 
Thanks, I don't do lots of coding, although this is pretty simple in this case.
It is something I can work with thanks.

I was hoping to build all of this away from VBA, if anybody has any ideas on how it can be done?

For now I will put in some code.

Cheers
 

Users who are viewing this thread

Back
Top Bottom