Set the value of a text box with VBA

R

R Meyer

I am trying to display the record count value of a recordset ran in VBA in a
text box on a form, however, I have been unable to get the result to display
after the form is open. If I stop the code before the form opens, while it
still in design view, the values are in the textboxes. I have tried assigning
the value to the Control Source, the Default Value, and to the Text value
(have not been successful with that). Please assist if possible.
 
B

Brendan Reynolds

R Meyer said:
I am trying to display the record count value of a recordset ran in VBA in
a
text box on a form, however, I have been unable to get the result to
display
after the form is open. If I stop the code before the form opens, while it
still in design view, the values are in the textboxes. I have tried
assigning
the value to the Control Source, the Default Value, and to the Text value
(have not been successful with that). Please assist if possible.


Try the Value property ....

Me.NameOfTextBox.Value = etc

As the Value property is the default property of an Access text box, you can
optionally leave out the explicit reference to the value property ...

Me.NameOfTextBox = etc
 

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