Default value not populating with VBA code

Trisha2014

New member
Local time
Today, 03:20
Joined
Mar 10, 2014
Messages
6
Dear ,

Can anyone please help me to find out why the code is showing error.

Private Sub Ref_Click()

Me.Ref.DefaultValue = Date

End Sub

I want that when I click the Ref field in the form the date field in the form get populated with todays date
 
Just use Me.Ref = Date().

I am not 100% sure but, DefaultValue is a Read only value, unless the form is opened in Design view.
 
Dear pr2-eugin,

This is not working to update the value in the date field of the form on click the Ref field.

Do I missing any step in the VBA code?
 
Are there any other events that the Ref text box triggers? Check them.
 

Users who are viewing this thread

Back
Top Bottom