Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fill Textbox Value in VBA - error 1

Status
Not open for further replies.

telande35

Programmer
Nov 27, 2004
24
BE
Hey,

Access 2000.

I made a report in acces and in the open event of the report I have an VBA-procedure.
My report has only 1 textnbox nl. Text2.

I tried in the VBA-procedure the following :
Me.Text2= "NAAM"

but i receive follwing error
You can't assign a value to this object (2448)

What do I wrong?
tkx
Nic


 
Seems that Text2 is bound ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hey,

No, it is not bound.

When I look in design in the textbox there is mentioned 'Unbound' and in the properties/Data/Record Source is empty.

nic
 
Uh, should that not be:

Me.Text2.Text= "NAAM"

I don't see how you can assign a value to a textbox - so IMHO the error is quite correct. You can assign a value to a textbox ...property.

Gerry
 
No, it is not bound
And what is the ControlSource property ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
hey

The Control Source Property is empty.

I also changed te onopen procedure in the following

First try :

Me!Text2.Text = "Testing"

I receive on runtime :
'2182'
You can't reference a property or pethiod for a control unless the control has focus.



second try :
Me!Text2.SetFocus
Me!Text2.Text = "Testing"
I receive on runtime :
'2478'
Microsoft doesn't allow you to use this method in the current view.

No idea what I am doing wrong.
Just trying to make a report with some textboxes that I will fill in via VBA-code.

Thanks in advance for your help.
Nic

 
in the open event of the report
Have you tried the Load event procedure instead ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for help.

There wasn't a Load event, but an activate event. When I put my code there it works.

Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top