Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Text Box in vb6
Name: gardenair Date: August 8, 2004 at 11:05:14 Pacific OS: win98 CPU/Ram: 450
Comment:
In Visual Basic6 I have two text boxes & a save button. I want that if there is no data in both text boxes i.e Text1 ,Text2 then it will show a message that input data in any of them. If there is data in Text1 & Text2 is empty and Vice Versa then my command button will work. Please guide me that how can i do that. Thanks.
Name: StuartS Date: August 8, 2004 at 14:37:40 Pacific
Reply:
if text1.text > "" OR text2.text > "" then command1.enabled = true else Command1.enabled = false
Put this code in the Text.change event for each of the text boxes
Stuart
0
Response Number 2
Name: egkenny Date: August 8, 2004 at 14:48:46 Pacific
Reply:
This will enable the Save button if either text box has text in it. If you can have text in only one box then you will have to change it.
Private Sub Text1_Change() CheckForData End Sub
Private Sub Text2_Change() CheckForData End Sub
Sub CheckForData() If Text1.Text = "" Or Text2.Text = "" Then EnterDataLabel.Visible = True Else EnterDataLabel.Visible = False End If If Text1.Text = "" And Text2.Text = "" Then SaveButton.Enabled = False Else SaveButton.Enabled = True End If End Sub
0
Response Number 3
Name: gardenair Date: August 8, 2004 at 18:43:33 Pacific
Reply:
Thanks Alert & egkenny for the guidence.The code is working fine.My result for the save button is now working fine.
Summary: this might be really simple, but im just wondering... how do i make it so text boxes in vb6 only allow numbers to be entered. ie, it will allow the input of 1 2 or 3, but if you try to type a b or c, ...
Summary: Dear all I added 10 text box in the form after run the form in my PC the design is well but after run it in other PC the size of Text Box changing and move it form the original place I think I have t...
Summary: I have two text boxes in Visual Basic6 .How can i restrict the user if he press enter key in the text box to switch to next text box when Text1 is enpty . NUL value... My code is as under pleas...