textBox Reference on Access forms

  • Thread starter Thread starter Mohammed dwaikat
  • Start date Start date
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
 
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..
 
Back
Top