ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Box Execution (https://www.excelbanter.com/excel-programming/302435-message-box-execution.html)

Myrna Rodriguez

Message Box Execution
 

Hi~

Please help VB debuggers...

I have a textbox inside a frame.
In addition, I validated the textbox to prompt a message
box "enter text" if textbox is empty when OK Button is triggered.
I did enter text in the textbox and the message box still displays after
executing code in OK Button.

This is code I wrote for textbox:
Private Sub txtoffice_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'display msg if textbox office is empty
If txtoffice.Text = "" Then
MsgBox "Enter Office Location"
Cancel = True
End If
End Sub

Thanks in advance for helping & have a happy day!!


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Bob Phillips[_6_]

Message Box Execution
 
Try adding this in

Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
txtoffice_Exit Cancel
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Myrna Rodriguez" wrote in message
...

Hi~

Please help VB debuggers...

I have a textbox inside a frame.
In addition, I validated the textbox to prompt a message
box "enter text" if textbox is empty when OK Button is triggered.
I did enter text in the textbox and the message box still displays after
executing code in OK Button.

This is code I wrote for textbox:
Private Sub txtoffice_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'display msg if textbox office is empty
If txtoffice.Text = "" Then
MsgBox "Enter Office Location"
Cancel = True
End If
End Sub

Thanks in advance for helping & have a happy day!!


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com