If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combobox Question
Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#2
|
|||
|
|||
Combobox Question
Can you not sort by last name in the query behind the combo box?
For FREE Access ebook and videos click here http://access-databases.com/ebook On Jan 19, 11:16*pm, Aria wrote: Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#3
|
|||
|
|||
Combobox Question
If the SQL statement that you posted is the query that is being used as the
cboFindAnEmployee combobox's RowSource query, then the combobox should be behaving as you wish. If you have something else for the combobox's RowSource property, post that for us to assist you. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Aria" wrote in message ... Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#4
|
|||
|
|||
Combobox Question
Thanks for responding. I believe the SQL statement indicates that it *is*
sorted by the last name. What I am looking to see is the name that begins the alpha list in the combobox. I hope that makes sense. For example, the first name in my combobox has a last name that starts with "Ab". I would *like* to see this name first, intead of "W" (which begins my last name). If I then have to input a last name that begins with "Aa" then *that* name is automatically shown in the combo. Any suggestions? -- Aria W. "troy23" wrote: Can you not sort by last name in the query behind the combo box? For FREE Access ebook and videos click here http://access-databases.com/ebook On Jan 19, 11:16 pm, Aria wrote: Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#5
|
|||
|
|||
Combobox Question
That's happening because of the code in the forms
Current event that keeps the search box in synch with the current record. Your name is the first record in the table, so when the form opens the Current event fires and moves the combo box to your name. If you don't want that to happen, open the code window for the Current event and comment out this line; Me.cboFindAnEmployee = Me.EmpID Cheers -- _________ Sean Bailey "Aria" wrote: Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#6
|
|||
|
|||
Combobox Question
I'm sorry, I must not be explaining very well.
The RowSource is: SELECT [tblEmployees].[EmpID], [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], [tblEmployees].[LastName], [tblEmployees].[FirstName]; What I see: In cboFindAnEmployee my name is shown in the box, I believe, because it is the first record I input. When you click on the drop-down arrow, all additional names are listed in alphabetical order. What I would like to see: Whomever has the first name in the list, their name shown in the box. If I input another record that falls ahead of that person in the alphabet, *their name is shown in the box first. Sorry for the confusion, I hope that explains a little better. -- Aria W. "Ken Snell (MVP)" wrote: If the SQL statement that you posted is the query that is being used as the cboFindAnEmployee combobox's RowSource query, then the combobox should be behaving as you wish. If you have something else for the combobox's RowSource property, post that for us to assist you. -- Ken Snell MS ACCESS MVP http://www.accessmvp.com/KDSnell/ "Aria" wrote in message ... Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#7
|
|||
|
|||
Combobox Question
Hi,
OK, I tried it and it's not quite what I was looking for but I do see what everyone is trying to tell me now. After following your suggestion, my name is removed and it doesn't show any name. So the answer would be I either keep the combo in synch with the current (1st) record or leave the space blank, correct? I can't show record #79 (for instance) just because the last name happens to come first in the alphabet. -- Aria W. "Beetle" wrote: That's happening because of the code in the forms Current event that keeps the search box in synch with the current record. Your name is the first record in the table, so when the form opens the Current event fires and moves the combo box to your name. If you don't want that to happen, open the code window for the Current event and comment out this line; Me.cboFindAnEmployee = Me.EmpID Cheers -- _________ Sean Bailey "Aria" wrote: Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#8
|
|||
|
|||
Combobox Question
You can use Me.cboFindAnEmployee = Me.cboFindAnEmployee.ItemData(0)
to get it to display the first name in the sort order. If you use this in your forms Open event it will move to the first name when the form opens, but after that it will display whichever name was selected last (as long as it isn't requeried by some other method). You could also use the Current event, but then it will move back to the first name every time you change records (which you may not want). -- _________ Sean Bailey "Aria" wrote: Hi, OK, I tried it and it's not quite what I was looking for but I do see what everyone is trying to tell me now. After following your suggestion, my name is removed and it doesn't show any name. So the answer would be I either keep the combo in synch with the current (1st) record or leave the space blank, correct? I can't show record #79 (for instance) just because the last name happens to come first in the alphabet. -- Aria W. "Beetle" wrote: That's happening because of the code in the forms Current event that keeps the search box in synch with the current record. Your name is the first record in the table, so when the form opens the Current event fires and moves the combo box to your name. If you don't want that to happen, open the code window for the Current event and comment out this line; Me.cboFindAnEmployee = Me.EmpID Cheers -- _________ Sean Bailey "Aria" wrote: Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
#9
|
|||
|
|||
Combobox Question
Thank you! That's exactly what I wanted.
-- Aria W. "Beetle" wrote: You can use Me.cboFindAnEmployee = Me.cboFindAnEmployee.ItemData(0) to get it to display the first name in the sort order. If you use this in your forms Open event it will move to the first name when the form opens, but after that it will display whichever name was selected last (as long as it isn't requeried by some other method). You could also use the Current event, but then it will move back to the first name every time you change records (which you may not want). -- _________ Sean Bailey "Aria" wrote: Hi, OK, I tried it and it's not quite what I was looking for but I do see what everyone is trying to tell me now. After following your suggestion, my name is removed and it doesn't show any name. So the answer would be I either keep the combo in synch with the current (1st) record or leave the space blank, correct? I can't show record #79 (for instance) just because the last name happens to come first in the alphabet. -- Aria W. "Beetle" wrote: That's happening because of the code in the forms Current event that keeps the search box in synch with the current record. Your name is the first record in the table, so when the form opens the Current event fires and moves the combo box to your name. If you don't want that to happen, open the code window for the Current event and comment out this line; Me.cboFindAnEmployee = Me.EmpID Cheers -- _________ Sean Bailey "Aria" wrote: Hello, Is there any way to have a combobox (cboFindAnEmployee) show the names in alphabetical order no matter which order the records were entered? I mean when you first open your database and not based on the first record? When I first created the combobox and tested it to see if it was working, I used my name for the first record and then others to test it. Quite frankly, I'm sick of seeing my name in the combobox since I'm towards the end of the alphabet. I would like whomever has the last name that starts the "A"s to show first. I know it's nitpicky but what can I say... I don't know if you need this info but here it it: SQL *** SELECT tblEmployees.EmpID, [LastName] & ", " & [FirstName] AS LastFirst FROM tblEmployees ORDER BY [LastName] & ", " & [FirstName], tblEmployees.LastName, tblEmployees.FirstName; Thank you for any suggestions. -- Aria W. |
Thread Tools | |
Display Modes | |
|
|