473,473 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to check null value for more text boxes

chandru8
145 New Member
hi to all
i am using vb6.0
is there any way to check more textboxes value is null or not
because in my form iam having 50 text boxes all should not be null

if (text1.text) <> "" and text2.text <> "" ..............then

end if

is there any better way than this
thanks to all
Mar 18 '08 #1
16 3836
natuvamurali
1 New Member
hello to all

i am new from software programme
p.l given me vb6.0 tovb.net convert the programme
how to do it
please reply to me
Mar 18 '08 #2
QVeen72
1,445 Recognized Expert Top Contributor
p.l given me vb6.0 tovb.net convert the programme
Browse and Open VB6 Project in VB.net, it will be directly prompt you to the Conversion Wizard..

REgards
Veena
Mar 18 '08 #3
QVeen72
1,445 Recognized Expert Top Contributor
if (text1.text) <> "" and text2.text <> "" ..............then

end if
TextBoxes are in Control array,
OR
they are named Text1, Text2.... Text50 ..?

Regards
Veena
Mar 18 '08 #4
chandru8
145 New Member
all are independent text1 ,text2........
Mar 18 '08 #5
debasisdas
8,127 Recognized Expert Expert
try something like this
Expand|Select|Wrap|Line Numbers
  1. Public Sub CheckControls(FrmCalled As Form)
  2. Dim i As Byte
  3.  
  4. For i = 0 To FrmCalled.Controls.Count - 1
  5.     If TypeOf FrmCalled.Controls(i) Is TextBox Then
  6.               ' add the code to check for null here.
  7.     End If
  8. Next i
  9. End Sub
  10.  
Mar 18 '08 #6
QVeen72
1,445 Recognized Expert Top Contributor
all are independent text1 ,text2........
Try this :

Expand|Select|Wrap|Line Numbers
  1. Private Function CheckBlank() As Boolean   
  2.     Dim ctl As Control
  3.     CheckBlank = False
  4.     For Each ctl In Me.Controls
  5.         If TypeOf ctl Is TextBox Then
  6.             If Trim(ctl.text) = "" Then 
  7.                 CheckBlank =True
  8.                 Exit Function
  9.             End If
  10.         End If
  11.     Next
  12. End Sub
  13.  
  14. 'Call This Code Before Saving..
  15. If CheckBlank Then
  16.   'Alert Message here 
  17. End If
  18.  
Regards
Veena
Mar 18 '08 #7
chandru8
145 New Member
thanks for your its working now
in another form some text boxes are scattered in the tabbed control
like
in tab 0 5 text boxes
in tab 1 10 text boxes
the above is not supporting this
Mar 18 '08 #8
QVeen72
1,445 Recognized Expert Top Contributor
thanks for your its working now
in another form some text boxes are scattered in the tabbed control
like
in tab 0 5 text boxes
in tab 1 10 text boxes
the above is not supporting this
MyCode or Debasis's code...?
Mar 18 '08 #9
chandru8
145 New Member
i have checked both the code it's working fine
Mar 18 '08 #10
debasisdas
8,127 Recognized Expert Expert
You need to use form_name.container_name.textbox_name and then loop through the controls.
Mar 18 '08 #11
chandru8
145 New Member
iam getting error
i need to check for the tab 0 when i click submit

For Each cntControl In frmNewRegistration.SSTab1(0).Controls
If TypeOf cntControl Is TextBox Then
If cntControl.Text = "" Then
MsgBox "Please enter all the details", vbExclamation
Exit Sub
End If
End If
next
Mar 18 '08 #12
debasisdas
8,127 Recognized Expert Expert
what is the error ? in which line ?
Mar 18 '08 #13
chandru8
145 New Member
compile error : Wrong number of arguments

error in -> SSTab1(0)

For Each cntControl In frmNewRegistration.SSTab1(0).Controls
Mar 18 '08 #14
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

I guess in VB6, All the Controls on the Form, (Irrespective of the Parent Container (Picturebox/Frame/SSTab) has parent as Form only.. so no need to pass SSTab (as it does not support Control Collection)

So Me.Cotrols gives complete Collection of all the Cotrols.
But in VB.net, If a TextBox is Placed on the GroupBox/SSTab, then its parent changes, this does not happen in VB6

REgards
Veena
Mar 18 '08 #15
debasisdas
8,127 Recognized Expert Expert
Please try as suggested in the previous post and let us know if that works.

I am not sure of SSTab.
Mar 18 '08 #16
chandru8
145 New Member
ok thanks for your reply
thank you very much
Mar 18 '08 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: KathyB | last post by:
Hi, I'm trying to find a way to validate input text boxes where I don't know the names until the page is rendered. I've got 2 validate functions that fire with the onsubmit button of a "mini" form...
4
by: KathyB | last post by:
Sorry this is a bit of a repost because I wasn't quite accurate in my original. I have an hmtl page with a function to see if there are any input type=text boxes. If so, that means a user did...
2
by: Stephen Miller | last post by:
I have a page with many, dynamically generated combo boxes and I want to check all of them, before I add a unique value to specific combo. What would be the best way to work through the document...
1
by: Steven Stewart | last post by:
Hi there, I have a form with a bound text box control and a frame with two unbound check boxes. When the user checks one of the check boxes, the bound text box control is set to a certain value...
1
by: Dalan | last post by:
I apparently need some assistance with Access 97 regarding the changing of a value in a field through use of a check box. I have a subform (sfrmDocList) with a column for indicating if a document...
4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
1
by: Java Kumar | last post by:
Hi Friends, I have a form which contains elements such as check boxes,text box,text area ., Problem is in Check boxes. By default, Check boxes are unchecked and text boxes...
1
by: mfaisalwarraich | last post by:
Hi Experts Around the World. Well im new to this paradise (Access). i have no experties in Access but i can still work with my mind :). i wish to request you people as under: I made a table...
6
by: KDawg44 | last post by:
Hi, My responseXML is always null on my AJAX call. When I browse directly to the PHP script I am calling, the XML file shows up just fine. I have read that if a returned XML file is not...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.