Wierd control? or...

deejay_totoro

Registered User.
Local time
Today, 21:38
Joined
May 29, 2003
Messages
169
Hello all,

I would like to place a button on my form that,that when clicked shows todays date in a field.

The button code looks like:

Me.myField = Now()

Also I have a control that displays anything in myField.

When I click on the "today button" the myField doesnt display anything, however the control mirroring myField does indeed show the date.

How may I show todays date in both the myField and control?

Many thanks!

dj_T
 
Sounds like the control mirroring myfield is an unbound text field.

A simple solution is to set the command buttons "On Click" event procedure to update the unbound text field with "Now()" then immediately update "myfield" with the contents of the unbound text field.

"On Click" event procedure looks like this:

Me.[unbound text field] = Now()
Me.myfield = [unbound text field]

HTH
 
No no..oh oh

Hello,

No that doesnt work. Its actually a combo box and whatever is entered in the combo box is mirrored in the control.

The (clearer!) code looks like this:

(on click event)
Me.MyComboBox = "25/12/2004"

works fine.

However if I do this:

Me.MyComboBox = Now()

the current date is correctly stored but not displayed.

VBA will not allow me to assign a value to this control (Me.myControl = Now() )

Any help?

thanks!

dj_T
 
Last edited:

Users who are viewing this thread

Back
Top Bottom