Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

Add Text only if one combo bos is enabled

$
0
0
I have a form with 7 text box which includes 2 combo box : ComboBox1 as Bank & ComboBox2 as Cheque....

while the form is running, if someone clicks in combobox2 then text4 & text5 gets enabled and then only one can insert values in the Textbox. Otherwise if Bank combbobox is selected, those two text box should remain hidden.

wat can i do...

here is my coding.. just the simple one...
Code:

Private Sub deposit_Click()
If rs.State = 1 Then
rs.Close
End If
If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" And Text4.Text <> "" And Text5.Text <> "" And Combo1.Text <> "" Then
rs.Open "insert into deposit_details values (" & Text1.Text & "," & Text2.Text & "," & Text3.Text & ",' " & Text4.Text & " '," & Text5.Text & "," & Combo1.Text & ")", con
End If
MsgBox " AMOUNT DEPOSITED "
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Combo1.Text = ""
Text1.SetFocus

here i have written a command to insert into every text box...it does not check which combo box is has been selected while the program is running...
so wat can i do!!

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>