Hello Guys. Good Day!
Masters of programming out there anybody can read mo this code guys how it work in the program for better understanding of mine. Thanks in advance for your help...
br.
Private Sub cmdsearch_Click()
On Error Resume Next
Dim dok As String
Dim ran As String
dok = InputBox("Enter " & Combo1 & " to Search", "Searching")
Adodc1.Recordset.Close
ran = "Select * FROM addressbook where " & Combo1.List(Combo1.ListIndex) & " = '" & dok & "'"
Adodc1.RecordSource = ran
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "No Record Found!", vbInformation
End If
End Sub
and this code:
Private Sub cmdsearch_Click()
On Error Resume Next
Dim dok As String
dok = InputBox("Enter " & Combo1 & " to Search", "Searching")
Adodc1.Refresh
Adodc1.Recordset.Find Combo1.List(Combo1.ListIndex) & " = '" & dok & "'"
If Adodc1.Recordset.EOF Then
MsgBox "No Record Found!", vbInformation
For i = 0 To Combo1.ListCount - 1
If i = Combo1.ListIndex Then DataGrid1.Columns(i).Visible = True
Next i
Else
For i = 0 To Combo1.ListCount - 1
If i = Combo1.ListIndex Then
DataGrid1.Columns(i).Visible = True
Else
DataGrid1.Columns(i).Visible = False
End If
Next i
End Sub
and this code:
Private Sub Form_Load()
Adodc1.CommandType = adCmdText
End Sub