Assign numeric value to bound text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to assign a numeric value (any type) to a bound text box preferably
from a variable. I keep getting an error message "object required" in an
Access database. May be simple to some of you but what do I need to do
to make it work?
 
You have to show your code or no one can tell why it's not working without
just guessing. To assign a value to a textbox called txtMyBox, you say:
me.txtMyBox = myVariable
-John
 
Thanks, John Welch. As you said, I may have to show my code. I tried
assigning it by using same code as you show. Tried it with bound textbox and
got error, "Object required". When textbox was unbound, it took the
assignment perfectly.
 
jumping jim said:
Thanks, John Welch. As you said, I may have to show my code. I tried
assigning it by using same code as you show. Tried it with bound textbox and
got error, "Object required". When textbox was unbound, it took the
assignment perfectly.

Code follows:
Module level: Public Counter as Integer
Public sub SetCounter()
Counter = 1
End Sub

On Open
Counter = 1
Forms![PELbsEntry]![txtQuad]=Counter

Error message: "You cannot enter this"
How can I make it work?
 
Back
Top