sorting a form by a combo box in other form

Sanoman

New member
Local time
Today, 23:04
Joined
Nov 25, 2003
Messages
9
Hi!

I want to sort my form with a Combo Box in another form.

The form frm_1, gets its data from a query qry_1 and the combo is forms![frm_2]![combo1] - it contains all field names from qry_1

I just cant figure out how to make the qry_1 take the field name by which it should be sorted from the combo.


I already had:

1.) qry.properties.sortby = forms![frm_2]![combo1]
but this obviously tells him to sort by a field which is not in the qry
2.) I tried to change the SQL ORDER BY Statement, but looks like a made something wrong, thoug it just had no effect:
ORDER BY "[qry_1]" & "." & "forms![frm_2]![combo1]";

maybe somone can help me out :D
Thanks!
-Michael
 
What is the rowsource for "forms![frm_2]![combo1]"?
 
try something like so:

qry.sql = "select .... from .... etc.... Order By " & forms![frm_2]![combo1]

or do the sorting on the form instead of the query

me.orderby = forms![frm_2]![combo1]
or maybe:
me.orderby = "qry_1." & forms![frm_2]![combo1]
or something along those lines ( i did later "airware")

Regards
 

Users who are viewing this thread

Back
Top Bottom