OrderBy has value

B

bw

When I use the toolbar to sort items on my form, the control that I sort goes into the
OrderBy property field.

I want the OrderBy property field to be empty each time I open this form.

Private Sub Form_Activate()
OrderBy = ""
End Sub

This is apparently not the way to do this...can someone explain?

Thanks,
Bernie
 
W

Wayne Morgan

Try

Me.OrderBy = ""

Activate will clear the OrderBy as you open the form, but it will also clear
it each time you return to the form if you leave the form open. To only make
sure that it gets cleared as the form opens try the Open or Load event.
 
B

bw

Thanks for your help, Wayne.

I did what you said, and this seems to be working just as I explained in my original inquiry.
After using Me.OrderBy = "", I then placed the following:
Msgbox "Me.OrderBy" and got a dialog box with nothing in it (as I would expect).

But then when I go into Design mode, there it is...the control name that I had sorted
several Form Opens ago.

It doesn't seem to be hurting anything (and is not sorting by this control), but...Why is it
there?

Thanks for any light you may shed.
Bernie
 
W

Wayne Morgan

Changes made at runtime aren't permanent. To make the change permanent you
would have to make the change in design mode, whether by code or manually.
 

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