Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple sort order selection in a search query 1

Status
Not open for further replies.

Peping

Programmer
Aug 21, 2002
205
US
How can i make my search query form to have a multiple sort order selection (in a combo box) in addition to a search text box, that will also switch index key and change columns and headers of the grid at the same time. I have made a search query form that open a common table where table names, fields & headers, caption are stored but using only one index. Would appreciate helpful tips. Thanks in advance.
 
How can i make my search query form to have a multiple sort order selection (in a combo box)

In the combobox list your indexes. Once the user selects one, in the valid of the combo:
Code:
LOCAL lcIndex
STORE this.displayValue to lcIndex
SELECT myTable
SET ORDER TO TAG &lcIndex
 
thanks mgagnon..
can i also make the new key field moved to the left most column of the grid as well as headers?
 
can i also make the new key field moved to the left most column of the grid as well as headers?

Can you explain? Do you want to add a column to a grid? Are you creating your grid by code or did you put it on the form?
 
My grid is in a form along with a search text box. I don't need to add a column on the grid but just move it once a new index is selected. if my current columns looks like: partno, upcno, descrip, price but a new index (lets say 'UPC') was selected then my grid should appear: upcno, partno, descrip, price order (upcno at left most) along with corresponding headers.
 
I think that it would be best to reconstruct your grid on-the-fly, instead of using a grid object. And everytime the combo is selected, reconstruct you grid based on the new order. Because renaming column names you have to account for the recordsource to be changing also. I would go whit a UDF that reconstructs you grid.
 
Peping

Is this form data entry or just looking up records? (No data entry). If it's no data entry, you could put a blank grid on your form, and re-create the grid on-the-fly instead, it woudl accomplish the same as recreating the grid, with less coding.
 
thanks mgagnon. my form is a lookup no data entry.
 
How about:

ThisForm.Grid1.Column3.ColumnOrder = 1
Dave S.
 
DSummZZZ

How about:

ThisForm.Grid1.Column3.ColumnOrder = 1


So simple....maybe too simple.


Mike Gagnon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top