Calulating "on the fly"

G

Guest

I have a form that I want to set a text box so I can use it to sort on.

I tried to set the Me.orderby = "txtbox" but this resulted in an error.

I then tried to set the orderby using the field name:
Me.orderby = "field1, field2, field2"
and this worked.

Next I tried to set the text box to show what the sort order was.
me.txtbox.controlsource = "[field1] & " " & [field2] & " " & [field3]"
This gives me a #error in the text box until I click on the form and scroll
down.

I can not get the form to refresh or update the information in the text box.

Any ideas?
 
F

fredg

I have a form that I want to set a text box so I can use it to sort on.

I tried to set the Me.orderby = "txtbox" but this resulted in an error.

I then tried to set the orderby using the field name:
Me.orderby = "field1, field2, field2"
and this worked.

Next I tried to set the text box to show what the sort order was.
me.txtbox.controlsource = "[field1] & " " & [field2] & " " & [field3]"
This gives me a #error in the text box until I click on the form and scroll
down.

I can not get the form to refresh or update the information in the text box.

Any ideas?

No need for VBA code.
Set the control source of an unbound control on your form to:

=forms!ThisFormName.Orderby
 

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