click option button - text1.text="" error

DavidCdp1

Registered User.
Local time
Today, 03:18
Joined
Dec 13, 2004
Messages
27
Hi

I have two option buttons, (hourly rate) and (daily rate). When I select hourly rate option then text1.enableed = true and text2.enabled = false. When I select Daily rate option then text1.text = "". But it is saying you can'g reference unless there is focus on it. How can I do it. Many thanks in advance for your help..
David.
 
To set the focus you would use :

Code:
yourobjectname.setfocus

But it sounds like your second check box should be :

Code:
Me.Text1 = ""

You might want to do some research into naming conventions in access.
HTH
Andy
 
Thank You very Much Andy...You are a star..Thanks
 
The problem is that you shouldn't be using the .text property. Read about this property in help. It is used differently in VBA than in VB. In VBA, you should use .value or just omit the property name since .value is the default.
 
Thanks for the information Pat..It is really helpful..

DavidCdp1
 

Users who are viewing this thread

Back
Top Bottom