Access 2007 Load event procedure

J

jastic

I have a form which is a list of queries and I want to create a load event
that will place the focus on the first query in the list box automatically.
It seems simple, but I keep getting an error:

Private Sub Form_Load()
'Move the focus to the list box and then to the first query in the list
lstQueryList.SetFocus
SendKeys "{Down}"
End Sub

My error is shows to be in "lstQueryList.SetFocus" Any suggestions?
Thanks for any replies!
 
S

Stuart McCall

jastic said:
I have a form which is a list of queries and I want to create a load event
that will place the focus on the first query in the list box
automatically.
It seems simple, but I keep getting an error:

Private Sub Form_Load()
'Move the focus to the list box and then to the first query in the
list
lstQueryList.SetFocus
SendKeys "{Down}"
End Sub

My error is shows to be in "lstQueryList.SetFocus" Any suggestions?
Thanks for any replies!

Me.ListboxName = Me.ListboxName.ItemData(0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top