Visual Basic Online Course Make Sure All TextBoxes Empty
Visual Basic Online Course
Learn how to
Make sure all Text boxes are clear first
Step by step guide
Say ......... you have 10 TextBox Controls and 10 ComboBox Controls on a VB6 form and you are taking their contents into a database tables, I guess you have to make sure that all the TextBox Controls and the ComboBox Controls are not empty ... So, you can do something like this ....
'Visual Basic Online Course
'Visual Basic 6
'Make Sure all Text Boxes are Empty / Clear first
Private Sub CMDSAVE_CLICK()
'The button that transfer contents to tables
'if textbox1.text And Textbox2.text and ..... etc then
MsgBox "Leave No Blanks"
exit sub
end if
'Some Codes ............
'Some Codes ............
rs.update 'Or however you connect
End Sub
I will try here to tell the VB project that TxtBx variable represents all the TextBox Controls on a form (Form1) and Cbos variable represents all the ComboBox Controls on the same form .... so the scenario would be:
Hey, Form1 .... Be aware that (TxtBx) represents all my Textbox Controls on You, and (Cbos) represents all my ComboBoex Controls on you, so whenever you find one Empty Just Give me a MsgBox MessageBox and (Exit) the sub . OK?
But If not! Then, continue updating my MS Access database tables .... are we clear, Form1 ??
How could we just Code These Lines of Scenario .......
Here we go :
'Visual Basic 6
'Make sure all textboxes are empty before save
Public Class Form1
Public TxtBx, Cbos As Control
Private Sub BtnSave_Click
For Each TxtBx In Me.Controls
If TypeOf TxtBx Is TextBox And String.IsNullOrEmpty(TxtBx.Text) Then
MsgBox("Leave No Blanks in TextBoxes")
Exit Sub
End If
Next
For Each Cbos In Me.Controls
If TypeOf Cbos Is ComboBox And String.IsNullOrEmpty(Cbos.Text) Then
MsgBox("Leave No Blanks in ComboBoxes")
Exit Sub
End If
Next
For Each Dtp In Me.Controls
If TypeOf Dtp Is MaskedTextBox And String.IsNullOrEmpty(Dtp.Text) Then
MsgBox("Leave No Blanks in Mobile Number")
Exit Sub
End If
Next
rs.addnew
Rs(".............") = TetxBox1.Text
'codes,codes,codes
rs.update
msgbox "Thanks for understanding, Form1"
End Sub
Comments
at this place.
Here is my webpage ... how to make money
glad to exhibit that I have an incredibly excellent uncanny feeling
I discovered just what I needed. I so much without a doubt will make sure to do not overlook this site and give it a glance on a constant basis.
Here is my site http://www.youtube.com/watch?v=ErFAXQcDoRU
My page; how to make free money online
this web page, and your views are fastidious
designed for new viewers.
Also visit my blog post: home business ideas
in favor of his site, because here every material is quality based information.
Here is my webpage ... how to Make money online fast
web page, and paragraph is really fruitful in
support of me, keep up posting these articles.
my webpage ... http://www.youtube.com/watch?v=ScFvd7Deva0
articles. I will bookmark your blog and test once more right here
regularly. I am moderately certain I'll be informed many new stuff proper right here! Best of luck for the next!
my blog - cedar finance reviews
Feel free to visit my webpage; how To make money fast online
Course 100% Free
Video Link: http://ow.ly/LMrzL
now each time a comment is added I get several e-mails with the same comment.
Is there any way you can remove people from that service?
Cheers!
Have a look at my web-site; WilheminaGDefries
Your favorite justification seemed to be at the
internet the easiest thing to have in mind of.
I say to you, I definitely get irked even as people
think about worries that they just do not realize about.
You managed to hit the nail upon the top as well as outlined out
the whole thing without having side-effects , people can take a signal.
Will likely be again to get more. Thank you
Check out my website :: EmilioVHamdn
clicked submit my comment didn't appear. Grrrr...
well I'm not writing all that over again. Anyhow, just wanted to say wonderful blog!
Also visit my weblog - ReaSPointdexter
to us, keep it up.
My weblog :: CandanceIDeprince
you're just extremely fantastic. I really like
what you've acquired here, really like what you are stating and the way in which you say it.
You make it entertaining and you still take care of to keep
it sensible. I can't wait to read far more from you.
This is actually a wonderful site.
Feel free to visit my website LaquandaCSchachsieck
this blog includes amazing and actually good stuff in support of visitors.
Here is my website; GeraldoNChamers
skilled blogger. I have joined your feed and look forward to in search of extra of your great
post. Also, I've shared your web site in my social networks
My website: KieshaESteiner
blog loading? I'm trying to determine if its a problem on my end or if it's the blog.
Any suggestions would be greatly appreciated.
Check out my web site CheryleSSandoual
put things off a lot and never seem to get anything done.
Stop by my web-site: EleanoreQGluck
similar one and i was just curious if you get a lot of spam
remarks? If so how do you prevent it, any plugin or
anything you can recommend? I get so much lately it's driving me mad so
any help is very much appreciated.
My weblog SybilSLiquet
this brilliant blog! I suppose for now i'll settle for book-marking and adding your RSS feed to my Google account.
I look forward to new updates and will talk about this website
with my Facebook group. Talk soon!
my blog: CristiAMaroney
to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She
put the shell to her ear and screamed. There was a hermit crab inside and it pinched her
ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!
Feel free to visit my web page :: CedrickNDescamps