strange ghost query on form load

matee

New member
Local time
Today, 17:49
Joined
Sep 17, 2003
Messages
7
hello..

i have a strange problem..
i posted it here because its more general than a querry question.
i created a button, that would sort a form:

Private Sub sortZa_Click()
Me.OrderByOn = True
Me.OrderBy = "[updated] DESC"
Me.Requery
End Sub

the problem i have is that sorting was working all the time, not only when i pushed the button ( like when i am starting a data base it sais "doing a query" or something like this and than it's sorted).
i did'n know how to solve this so i delated a button and code..

strange thing is that every time i start this data base it's beeing sorted!! eve with button delated.

any1 have an idea what's going on?

thanks.

Mateusz Zawada

p.s. i think it is written somewhere in sql.. but where to look for it?
p.p.s. how to make a sorting button that will execute the sorting once? not all the time?
 
Last edited:
Your button does the sort only once....

In your form (or query) the sort is allready beeing done.

Open your form in design and check the form properties => Data => Order by

or check the table/query (also properties => data) => Data source

Regards

The Mailman
 
wow..!! i didn't know about that.
that did the trick!!
thanks a lot!! i've been fighting it for 2-3 days now.

Mateusz Zawada.

P.S. thank you one more time :D
 
one more question..
i would like to cancel this sorting..
i was thinking about somethink like this.

Me.Orderby=null
or
Me.orderby=""

but this doesn't work.. :(
 
Your sure the sorting is not going on in the query/table in charge of the form?

Post your (empty) db, if possible, if you find you cannot solve it.

Canceling a sort should be the opposite of the sort...

Me.orderbyon = false'this in itself should be enough (maybe folowed by a requery)
me.orderby = ""
me.requery ' not sure if it is needed at all (test it)

Regards

The Mailman
 

Users who are viewing this thread

Back
Top Bottom