mattmexcel
Board Regular
- Joined
- Dec 5, 2007
- Messages
- 59
Happy Friday,
I'm working on a user form with tabbed browsing and can't quite figure this one out.
I have a tab with two text boxes on it that get user inputs. If a user clicks a different tab, and the value in first text box is higher than the other, i want a message box to pop up saying that the other value must be greater than or equal to the first value. I get this to happen using the following code:
However, after the user hits "OK" it takes them to whichever tab they have clicked on. I want the focus to stay on the current tab so that they can make the changes. Any thoughts?
Thanks,
Matt
I'm working on a user form with tabbed browsing and can't quite figure this one out.
I have a tab with two text boxes on it that get user inputs. If a user clicks a different tab, and the value in first text box is higher than the other, i want a message box to pop up saying that the other value must be greater than or equal to the first value. I get this to happen using the following code:
Code:
Private Sub MultiPage1_Change()
'Return error if capitalized interest is greater than interest only
If txtCapI.Value > txtInterestOnly.Value Then
MsgBox "Interest only must be equal to or greater than Capitalized Interest. Please update assumptions.", vbOKOnly, "Error"
End If
However, after the user hits "OK" it takes them to whichever tab they have clicked on. I want the focus to stay on the current tab so that they can make the changes. Any thoughts?
Thanks,
Matt