User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,608 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,456 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 1933 | Replies: 3
Reply
Join Date: Nov 2007
Posts: 14
Reputation: saravanarajan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
saravanarajan saravanarajan is offline Offline
Newbie Poster

Plz help me for Validation in VB.NET

  #1  
Nov 10th, 2007
Hi!
Everyone I am doing one business project in VB.NET... that every form and controls validation are very important, please help me....I am beginner of the VB.NET, suppose to run the form, after finishing data entry to click EXIT button, to show the msgbox if 'yes' close the form, 'no' form never closed...like how i check SAVE,DELETE,EDIT after i am going to click these buttons check the mandatory field.... please help me...VERY URGENT

My advance thanks
Saravanarajan
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2006
Posts: 117
Reputation: manal is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
manal's Avatar
manal manal is offline Offline
Junior Poster

Re: Plz help me for Validation in VB.NET

  #2  
Nov 11th, 2007
i am not sure if i understand you .
any way to check mandatory fields , check they not empty
for example if user must enter ID in textbox check it like this
if Id_textbox="" then 
Label1.Text = "you must enter the ID"
end if 
about confirming exit the form use msgbox like this
Dim c As Integer
c = MsgBox("are you sure you want to exit", MsgBoxStyle.OKCancel, "Exit")
        If c = 1 Then
            Me.Close()
        End If
Last edited by manal : Nov 11th, 2007 at 3:03 am.
"give only what u willing to receive "
Reply With Quote  
Join Date: Nov 2007
Posts: 14
Reputation: saravanarajan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
saravanarajan saravanarajan is offline Offline
Newbie Poster

Re: Plz help me for Validation in VB.NET

  #3  
Nov 12th, 2007
its only working exit button query.....plz understand my problem but if click save button at the time to check all the mandatory field and also to show all the field in list to user with msg, "you must enter these fields.....plese help me

regds,
saravanarajan
Last edited by saravanarajan : Nov 12th, 2007 at 12:24 am.
Reply With Quote  
Join Date: Apr 2007
Posts: 4
Reputation: samiullah478 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
samiullah478 samiullah478 is offline Offline
Newbie Poster

Re: Plz help me for Validation in VB.NET

  #4  
Nov 12th, 2007
Hi u can do like this

If Me.Txt_Width.Text = "" Then
MessageBox.Show("Please Enter Width Information")
Me.Txt_Width.Focus()

ElseIf Me.Txt_Width.Text.Length > 5 Then
MessageBox.Show("Please Enter Length Less Than 5")
Me.Txt_Width.Focus()

ElseIf Not Me.regex_Num.IsMatch(Me.Txt_Width.Text) Then
MessageBox.Show("Please Enter Only Digits")
Me.Txt_Width.Focus()

ElseIf Me.Txt_Length.Text = "" Then
MessageBox.Show("Please Enter Length Information")
Me.Txt_Length.Focus()

ElseIf Me.Txt_Length.Text.Length > 5 Then
MessageBox.Show("Please Enter Length Less Than 5")
Me.Txt_Width.Focus()

ElseIf Not Me.regex_Num.IsMatch(Me.Txt_Width.Text) Then
MessageBox.Show("Please Enter Only Digits")
Me.Txt_Length.Focus()

ElseIf Me.Txt_Nearest_Location.Text = "" Then
MessageBox.Show("Please Enter Nearest Location Information")
Me.Txt_Nearest_Location.Focus()

ElseIf Me.Txt_Nearest_Location.Text.Length > 100 Then
MessageBox.Show("Please Enter Length Less Than 100")
Me.Txt_Nearest_Location.Focus()

ElseIf Me.Txt_Code.Text = "" Then
MessageBox.Show("Please Enter Board Code Information")
Me.Txt_Code.Focus()

ElseIf Me.Txt_Map_Reference.Text = """" Then
MessageBox.Show("Please Enter Board Map Reference Information")
Me.Txt_Code.Focus()

ElseIf Not regex_Num.IsMatch(Me.Txt_Code.Text) Then
MessageBox.Show("Please Enter Number In Correct Format")
Me.Txt_Code.Focus()

ElseIf Me.Txt_Map_Reference.Text = "" Then
MessageBox.Show("Please Enter Map Reference information")
Me.Txt_Map_Reference.Focus()
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 7:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC