How do I change the cursor starting position?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a combo box and two buttons. When the form opens the
cursor starts on the first button. If you tab, it tabs between the two
buttons and never goes over to the combo box.
How can I get it to start at the combo box when it opens? I've tried
changing the tab order but that did not make a difference.
Thanks,
 
A couple of things can be going on here. First, be sure the Tab Stop
property of the combo is set to Yes. Secondly, if you have the combo in a
different form section like the header or footer of the form, it will not tab
automatically. You will have to add some event code to make it tab from
section to section.
 
I changed the Tab Stop Property to Yes and that brought the cursor to the
combo box when the form is opened. (Yea, thank you)

Now once you click on a selection, you have to click on the button or tab to
the button. Is there away to make it tab automatically to the button so you
could just hit enter after making your selection?
 
You could use the OnCurrent event of the form to set the focus to any
object that suits you. Or use the AfterUpdate event of the combo box
for the same purpose.

hth- Betsy
 
The current event would only be correct if you want the focus on that control
when you move to a new record. I believe in this case, he wants to start
with the combo, so to do that, he could use this in the current event:

Me.MyCombo.Setfocus
 
I am totally new to this visual basic stuff. Argh! Below is my After Update
code. Should I be putting the "Me.NextButton.SetFocus" in there somewhere?
I tried a couple different things, to no available.
More help please....:)



Option Compare Database

Private Sub cmb_tbl_pc_id_AfterUpdate()
Me.Filter = "tbl_prod_code_name.tbl_pc_id='" & Me.cmb_tbl_pc_id & "'"
Me.FilterOn = True
Me.Requery
End Sub

Private Sub Id_okay_Click()
On Error GoTo Err_Id_okay_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_selection_prod_code_list"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Id_okay_Click:
Exit Sub

Err_Id_okay_Click:
MsgBox Err.Description
Resume Exit_Id_okay_Click

End Sub
 
Back
Top