Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub Combo1_Click()
If rs.State = 1 Then rs.Close
rs.Open "select * from register where id=" & Combo1.Text, con, adOpenDynamic, adLockOptimistic
Set MSHFlexGrid1.DataSource = rs
End Sub

Private Sub Command1_Click()
If Option1.Value = True Then
If rs.State = 1 Then rs.Close
rs.Open "select * from register where id=" & Combo1.Text, con, adOpenDynamic, adLockOptimistic
Set MSHFlexGrid1.DataSource = rs


ElseIf Option2.Value = True Then
If rs.State = 1 Then rs.Close
rs.Open "select * from budget where cate='" & Text1.Text & "'", con, adOpenDynamic, adLockOptimistic
'If rs.BOF = False Then
 Set MSHFlexGrid1.DataSource = rs
'Else
   'MsgBox ("No data found")
End If
'End If
If Option3.Value = True Then
If rs.State = 1 Then rs.Close
rs.Open "select * from budget where balance='" & Text2.Text & "'", con, adOpenDynamic, adLockOptimistic
'If rs.BOF = False Then
 Set MSHFlexGrid1.DataSource = rs
 
'Else
   'MsgBox ("No data found")
'End If
End If

End Sub

Private Sub Command2_Click()
MDIForm1.Show
End Sub

Private Sub Form_Load()
connectdb
If rs.State = 1 Then rs.Close
rs.Open "select id from register", con, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Combo1.AddItem rs(0)
rs.MoveNext
Wend
Frame2.Enabled = False
End Sub

Private Sub Option1_Click()
Frame2.Enabled = True
Label1.Caption = "customer ID"
Text1.Visible = False
Combo1.Visible = True
Text2.Visible = False
End Sub

Private Sub Option2_Click()
Frame2.Enabled = True
Label1.Caption = " Event Name"
Text1.Visible = True
Text2.Visible = False
Combo1.Visible = False
End Sub

Private Sub Option3_Click()
Frame2.Enabled = True
Label1.Caption = "balance"
Text1.Visible = False
Combo1.Visible = False
Text2.Visible = True
End Sub
Posted
Updated 19-Jul-15 9:30am
v2
Comments
[no name] 19-Jul-15 15:33pm    
Just dumping a bunch of code into a posting without any explanation is not a question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900