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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)