textBox Reference on Access forms

M

Mohammed dwaikat

Hi Gang

I have a problem accessing a textbox on an access 2000 form, text1,text2
I want to set the value of text1 into text2, but it doesn't work, it always
gives the error number 2185 (You can not reference a property or method for
a control unless the control has the focus) is there any solution for that


Thank You
Mohammed Dwaikat
 
P

Patrick

The problem might reside in the way you affect the data to
the textbox.
You're probably writing something like:
text2.text=text1.text ' that's the reason for the error
msg.
Instead write:
text2.Value=text1.Value
This should get rid of the problem. If text1 box is empty
you might need to write code that deals with the Null
factor. Like

If isNull(text1.value) then
' do soemthing else
else
text2.Value=text1.Value
End If
Hope this Helps..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top