VBYesNo based on Combo Box Selection

G

Greg

I have a combo box on a page 1 of a tab control. If a certain item is
selected in the combo box, it will trigger a messagebox(VBYesNo). If the
click is yes, I want the tab control to go from page 1 to page 2. If the
click is no, I want to set the focus on a text box within page 1.

I have tried lots of different things and nothing seems to work...

Thanks in advance for your help.....

Greg
 
D

Dirk Goldgar

Greg said:
I have a combo box on a page 1 of a tab control. If a certain item is
selected in the combo box, it will trigger a messagebox(VBYesNo). If
the click is yes, I want the tab control to go from page 1 to page 2.
If the click is no, I want to set the focus on a text box within page
1.

I have tried lots of different things and nothing seems to work...

It would help if you described some of the things you've tried. In
principle, it could be something like this:

If MsgBox( _
"Go to next page?", _
vbQuestion+vbYesNo, _
"What Now?") _
= vbYes _
Then
Me!MyTabControl = 1 ' switch to second page
Else
Me!MyTextboxOnPage1.SetFocus
End If
 
G

Greg

My apologies,

Thanks for your help

Dirk Goldgar said:
It would help if you described some of the things you've tried. In
principle, it could be something like this:

If MsgBox( _
"Go to next page?", _
vbQuestion+vbYesNo, _
"What Now?") _
= vbYes _
Then
Me!MyTabControl = 1 ' switch to second page
Else
Me!MyTextboxOnPage1.SetFocus
End If


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Top