PDA

View Full Version : Mandatory Field pop up arise when you submit the userform



hdevadiga
02-26-2011, 12:03 AM
Hi Friends,

Hi, myself Hari.. I got stuck in between my work while creating a mandatory field pop up alert for userform when user try to submit the data..

For Example:

I want a mandatory field pop up alert when user try to submit the form.

Text Box1 -- Data is (Account Number)
Text Box2 -- Data is (Date)

When user click on submit button if user not provide the account number field a user get Mandatory Field Alert...

fumei
03-07-2011, 10:02 AM
Sub OKButton_Click() ' the submit button
If TextBox1.Text = "" Then ' if Textbox1 is blank
Msgbox "Account Number field is blank." ' give message
Exit Sub ' and exit
Else ' if Textbox1 is not blank
' whatever you are doing
End If
End Sub