Re: Move to index in combo box
- From: Banaticus <Banaticus@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 4 Feb 2006 09:09:10 -0800
Thanks for your help.
I now have a command button where the Click (I keep wanting to type onClick)
command is:[code]Private Sub Command_Button_A_Click()
Me![Names Combo Box].RowSource = "Long SQL statement"
End Sub[/code]This changes the rowsource to all last names that begin with
an A (actually, an A or a B) but it doesn't change the name of the person in
the combo box. To the user, who's clicking the "A-B" command button,
apparently nothing is happening. I tried adding:
Me.Names_Combo_Box.Requery
Which resets the combo box, but still leaves the "top area", the area that
the user sees without clicking anywhere, blank.
I also have this same problem when the form loads, the combo box's top line
is blank. I guess if I put in an OnLoad function that calls the first
possible arguement in the combo box's list then both of these problems would
be solved.
I'm looking for some way to change the Combo Box to the top item in its list
"Jeff Boyce" wrote:
Banaticus.
I don't know if I'd call folks who are so mouse-centric "completely computer
illiterate" <g>...
Are you sure you (and your customers) really want to take up all the "real
estate" on the screen to put buttons with "A", "B", "C", ... "Z" on them?
You won't have much room left for actual meaningful data!
Oh well, whatever! Give this a try...
Add a command button with "A" on it. In the Click event for that button,
modify the SQL statement your combo box uses to list names. For example, if
your combo box uses something like:
"SELECT * FROM YourTable"
you would modify that to something like:
"SELECT * FROM YourTable WHERE YourNameField Like 'A' & '*'"
You might need to mess with the single/double quotes to get it to work the
way you want.
Then, still in the Click event, you'd set the RowSource property of the
combo box to this new SQL statement, with something like:
Me!YourComboBox.RowSource = ... (your new SQL string)
Good luck!
Jeff Boyce
<Office/Access MVP>
"Banaticus" <Banaticus@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:089FB5FF-0C6F-4186-91E9-B3DD032F2F38@xxxxxxxxxxxxxxxx
Yes, I use that auto-complete when I'm using it, but this is a feature
requested by completely computer illiterate people who, even if it takes
10
times longer, would rather navigate solely by mouse without ever touching
the
keyboard.
The combo box has a property you can set that will "auto-complete" when
you
begin typing. No need to set up additional controls (i.e., boxes) to
filter
the combo box.
The combo box itself is already set to auto-complete and limit to list.
- Follow-Ups:
- Re: Move to index in combo box
- From: Jeff Boyce
- Re: Move to index in combo box
- References:
- Re: Move to index in combo box
- From: Jeff Boyce
- Re: Move to index in combo box
- From: Jeff Boyce
- Re: Move to index in combo box
- Prev by Date: Re: Help with code (Importing files)
- Next by Date: Change in MSysObjects..?
- Previous by thread: Re: Move to index in combo box
- Next by thread: Re: Move to index in combo box
- Index(es):