dbTalk Databases Forums  

Setting focus after selection in combo box?

comp.database.ms-access comp.database.ms-access


Discuss Setting focus after selection in combo box? in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Orv
 
Posts: n/a

Default Setting focus after selection in combo box? - 10-24-2008 , 11:28 PM






I have a "Yes/No" combo box (set to required) and I want the focus to shift
to differnet controls (on the same form) based on the selection of "Yes" or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003



Reply With Quote
  #2  
Old   
John
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-24-2008 , 11:44 PM






Hello.

You have a couple of choices of where to put this. I would probably put
it in the AfterUpdate event, because this should set the focus to the
next control as soon as a value is selected from the list. Putting it in
the OnExit event would work, but the focus wouldn't shift to the
specified control until the user exits the combo box.

It would probably look something like this:

Private Sub Combo0_AfterUpdate()

If Combo0.Value = "Yes" then
Control1.SetFocus
Else
Control2.SetFocus
End If

End Sub





Orv wrote:
Quote:
I have a "Yes/No" combo box (set to required) and I want the focus to shift
to differnet controls (on the same form) based on the selection of "Yes" or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003



Reply With Quote
  #3  
Old   
John
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-24-2008 , 11:44 PM



Hello.

You have a couple of choices of where to put this. I would probably put
it in the AfterUpdate event, because this should set the focus to the
next control as soon as a value is selected from the list. Putting it in
the OnExit event would work, but the focus wouldn't shift to the
specified control until the user exits the combo box.

It would probably look something like this:

Private Sub Combo0_AfterUpdate()

If Combo0.Value = "Yes" then
Control1.SetFocus
Else
Control2.SetFocus
End If

End Sub





Orv wrote:
Quote:
I have a "Yes/No" combo box (set to required) and I want the focus to shift
to differnet controls (on the same form) based on the selection of "Yes" or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003



Reply With Quote
  #4  
Old   
John
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-24-2008 , 11:44 PM



Hello.

You have a couple of choices of where to put this. I would probably put
it in the AfterUpdate event, because this should set the focus to the
next control as soon as a value is selected from the list. Putting it in
the OnExit event would work, but the focus wouldn't shift to the
specified control until the user exits the combo box.

It would probably look something like this:

Private Sub Combo0_AfterUpdate()

If Combo0.Value = "Yes" then
Control1.SetFocus
Else
Control2.SetFocus
End If

End Sub





Orv wrote:
Quote:
I have a "Yes/No" combo box (set to required) and I want the focus to shift
to differnet controls (on the same form) based on the selection of "Yes" or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003



Reply With Quote
  #5  
Old   
John
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-24-2008 , 11:44 PM



Hello.

You have a couple of choices of where to put this. I would probably put
it in the AfterUpdate event, because this should set the focus to the
next control as soon as a value is selected from the list. Putting it in
the OnExit event would work, but the focus wouldn't shift to the
specified control until the user exits the combo box.

It would probably look something like this:

Private Sub Combo0_AfterUpdate()

If Combo0.Value = "Yes" then
Control1.SetFocus
Else
Control2.SetFocus
End If

End Sub





Orv wrote:
Quote:
I have a "Yes/No" combo box (set to required) and I want the focus to shift
to differnet controls (on the same form) based on the selection of "Yes" or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003



Reply With Quote
  #6  
Old   
Orv
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-25-2008 , 06:31 AM



Thanks for the quick help.
I can't get either of the examples to work.
They both go to the next control.

I tried a simple testDB with only the 3 controls (flat DB and it still went
to the next control) instead of the "Yes/No" being pulled from seperate tbl.
I know I'm making this harder than it is.



"fredg" <fgutkind (AT) example (DOT) invalid> wrote

Quote:
On Sat, 25 Oct 2008 00:28:33 -0400, Orv wrote:

I have a "Yes/No" combo box (set to required) and I want the focus to
shift
to differnet controls (on the same form) based on the selection of "Yes"
or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003

Code the Combo Box's AfterUpdate event:
If Me![ComboName] = "Yes" Then
Me![ControlA].SetFocus
Else
Me![ControlB].SetFocus
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail




Reply With Quote
  #7  
Old   
Orv
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-25-2008 , 06:31 AM



Thanks for the quick help.
I can't get either of the examples to work.
They both go to the next control.

I tried a simple testDB with only the 3 controls (flat DB and it still went
to the next control) instead of the "Yes/No" being pulled from seperate tbl.
I know I'm making this harder than it is.



"fredg" <fgutkind (AT) example (DOT) invalid> wrote

Quote:
On Sat, 25 Oct 2008 00:28:33 -0400, Orv wrote:

I have a "Yes/No" combo box (set to required) and I want the focus to
shift
to differnet controls (on the same form) based on the selection of "Yes"
or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003

Code the Combo Box's AfterUpdate event:
If Me![ComboName] = "Yes" Then
Me![ControlA].SetFocus
Else
Me![ControlB].SetFocus
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail




Reply With Quote
  #8  
Old   
Orv
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-25-2008 , 06:31 AM



Thanks for the quick help.
I can't get either of the examples to work.
They both go to the next control.

I tried a simple testDB with only the 3 controls (flat DB and it still went
to the next control) instead of the "Yes/No" being pulled from seperate tbl.
I know I'm making this harder than it is.



"fredg" <fgutkind (AT) example (DOT) invalid> wrote

Quote:
On Sat, 25 Oct 2008 00:28:33 -0400, Orv wrote:

I have a "Yes/No" combo box (set to required) and I want the focus to
shift
to differnet controls (on the same form) based on the selection of "Yes"
or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003

Code the Combo Box's AfterUpdate event:
If Me![ComboName] = "Yes" Then
Me![ControlA].SetFocus
Else
Me![ControlB].SetFocus
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail




Reply With Quote
  #9  
Old   
Orv
 
Posts: n/a

Default Re: Setting focus after selection in combo box? - 10-25-2008 , 06:31 AM



Thanks for the quick help.
I can't get either of the examples to work.
They both go to the next control.

I tried a simple testDB with only the 3 controls (flat DB and it still went
to the next control) instead of the "Yes/No" being pulled from seperate tbl.
I know I'm making this harder than it is.



"fredg" <fgutkind (AT) example (DOT) invalid> wrote

Quote:
On Sat, 25 Oct 2008 00:28:33 -0400, Orv wrote:

I have a "Yes/No" combo box (set to required) and I want the focus to
shift
to differnet controls (on the same form) based on the selection of "Yes"
or
"No". Would this have to be placed on the "Exit" event?

I tried Google...and no luck.
I'm sure there's gonna be an "If" statement involved.

TIA,
-Orv
Access2003

Code the Combo Box's AfterUpdate event:
If Me![ComboName] = "Yes" Then
Me![ControlA].SetFocus
Else
Me![ControlB].SetFocus
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.