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
|
|||
|
|||
listbox and set focus
I have a list box on a form and have the following code onload for form
Private Sub Form_Load() Me.lbxNameSearch.SetFocus End Sub when the form opens it does not set focus to listbox. The first record is not hilighted. What is wrong with above code? |
#2
|
|||
|
|||
listbox and set focus
Setting focus to the listbox doesn't select the first item. This will do the
job: Private Sub Form_Load() lbxNameSearch.SetFocus Me.lbxNameSearch.Selected(0) = True End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200909/1 |
#3
|
|||
|
|||
listbox and set focus
Thank you that solved THAT problem. now i can not move up and down in the
list box with the arrow keys. If I click the selected record with mouse then I can move through the listbox with arrow keys. How can I make arrow keys work without clicking the mouse? "Linq Adams via AccessMonster.com" wrote: Setting focus to the listbox doesn't select the first item. This will do the job: Private Sub Form_Load() lbxNameSearch.SetFocus Me.lbxNameSearch.Selected(0) = True End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200909/1 |
#4
|
|||
|
|||
listbox and set focus
Is your listbox Multi-Select property set to something other than None?
That's the only way I could reproduce not being able to use the arrows to navigate the box. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200909/1 |
Thread Tools | |
Display Modes | |
|
|