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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use Ascending in combo box?

Status
Not open for further replies.

lebanoncedars

Programmer
Jul 17, 2002
43
CA
HI guys,

If I have a combo box in continous form.

Anyone knows How can I use ascending and decending in combo box to put Date field in order?

Thank you
Lebanoncedars
 
Hi
You set the sort parameter in the underlying query of the combo box

Or am I missing something? Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
hi Ken,

Thank you for replying back,
I wish, I know how to set all that from scratch.

But how can I do that, if possible details PLS.
New with these stuff.

Thanks millions.
Lebanoncedars
 
Hi

In design view.

Select the combo box.

Look in the properties window

Find the property .RowSource

Click on to the right of it, in the grey area, there should be a builder button (with ... on it).

This will bring up a query builder grid

Set the sort parameter of the relevant column
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi Ken,

Up to now everything is clear.

but before that. How can I create Ascending and Descending in the combo to call that query.

Do I have to create a table called Combo box and create ascending and descending in it, whats after that?.. or I'm missing something.

Sorry.. I think I'm missing alot here.
what is the procedure to complete and finish the problem.

Thanks millions

Lebanoncedars
 
Hi

Yes I think we have our wires crossed.

I thought you wanted to sort an existing query which populated your combo box, in either ascending or descending order.

I know think you want to have a combo box which reaads either Ascending or Descending and which you use to determine the order of another recordset, am I right?

To get the Ascending/Descending in your combo box, use the wizard to create a combo box, when it asks you where the data is to come from, say it is 1 column, and you will enter it, then it will give you a dialog to eneter the words Ascending and Descending, it will then create the combo.

OK? Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
HI Ken,
So far doing alright.
No I have Ascending and Descending in the combo box.
so I need Ascending option to trigger LastName in continous form in order and the same for Descending option.

How can that be done?

Thanks
Lebanoncedars
 
Hi ken,
Maybe I'm not clear enough sorry about that.
I need to sort lastName in Alphabetic order. So I like to use combo box with Ascending and Descending so I can sort them.

This is the whole idea.. Sorry about all the trouble, I don't know if I was clear enough.
I don't know if we are on the same track?

Thank you
 
Hi

OK we are both talking about the same thing now.

How are you doing the record source of the continuous form?

Is it a saved query?

What you need to do is to make it an SQL string in the after update event of the combo box, and then set it into the recordsource of the form.

I cannot give you the exact code without knowing all about your query, but the idea is like this (in the after update event of the conbo box remember.

Dim strSQL As String

strSQL = "SELECT * From tblEmployees ORDER BY LastName "
If cboOrderBy = "Descending" Then
strSQL = strSQL & "DESC"
End If
Me.Recordsource = strSQL
Me.Requery


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi

Forgot to say, if you are unsure about how to make teh SQL string, look at the query which is the recordsource of your form at the moment, in design view, and switch to SQL view, it will show you the SQL string, yoy can copy and paste this into your code. You will have to edit is a bit to get rid of Carriage REturns etc, but it will get you started

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi ken,
Thanks for now..I will get back to you later, tonight.

Thank you
Lebanoncedars
 
Hi

I am in the UK, so it is 20:15 here, and it id Friday night, so I am off to the pub, you will get little sense out of me for the rest of the night I am afraid.

Regards


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top