Moving Cursor

G

Guest

On a form, I am trying to move the cursor based on the value a user selects
in a Yes/No combo box. If the user selects Yes, I want to move the cursor to
field1. If the user selects No, I want to move to field2.
Thanks
 
S

Steve Schapel

Fpetrucci007,

Try code like this on the After Update event of the combobox...

Select Case Me.YourCombobox
Case "Yes"
Me.field1.SetFocus
Case "No"
Me.field2.SetFocus
End Select

....or, another way of doing the same thing...

If IsNull(Me.YourCombobox) Then
' do nothing
Else
If Me.YourCombobox = "Yes" Then
Me.field1.SetFocus
Else
Me.field2.SetFocus
End If
End If
 
F

fredg

On a form, I am trying to move the cursor based on the value a user selects
in a Yes/No combo box. If the user selects Yes, I want to move the cursor to
field1. If the user selects No, I want to move to field2.
Thanks

A "Yes"/"No" Combo box or a yes/No Check Box?

If it is a Combo Box with Yes and No as Text, code the combo box
AfterUpdate event:

If Me!ComboName = "Yes" Then
[field1].SetFocus
Else
[field2].SetFocus
End If

If it is a check box, then code the check box AfterUpdate event:

If Me!CheckBoxName] = -1 Then
[field1].SetFocus
Else
[field2].SetFocus
End If
 
G

Guest

A yes/no combo box? Not your best design. It would be about as good as an
option group with 20 options.

fredg said:
On a form, I am trying to move the cursor based on the value a user selects
in a Yes/No combo box. If the user selects Yes, I want to move the cursor to
field1. If the user selects No, I want to move to field2.
Thanks

A "Yes"/"No" Combo box or a yes/No Check Box?

If it is a Combo Box with Yes and No as Text, code the combo box
AfterUpdate event:

If Me!ComboName = "Yes" Then
[field1].SetFocus
Else
[field2].SetFocus
End If

If it is a check box, then code the check box AfterUpdate event:

If Me!CheckBoxName] = -1 Then
[field1].SetFocus
Else
[field2].SetFocus
End If
 

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