When I click on the command button, I recieve an inputbox. There I fill in the name of my client. Then when I put on Ok, I would like to recieve only the record of the client.
I tried olready, but I always recieve all the information of all the clients.
What am I doing wrong?
Who can help me?
Here is the code I made:
Private Sub cmdSearchClient_Click()
Dim Db As CurrentProject
Dim frm As Form_frmKlantenfiche
Dim Klantennaam, strSQL As String
Set Db = CurrentProject
Klantennaam = InputBox("Which client are you searching for? ")
strSQL = "Select * from frmKlantenfiche where naam_kl=" & Klantennaam
DoCmd.OpenForm "frmKlantenfiche"
Naam_kl.SetFocus
End Sub
I tried olready, but I always recieve all the information of all the clients.
What am I doing wrong?
Who can help me?
Here is the code I made:
Private Sub cmdSearchClient_Click()
Dim Db As CurrentProject
Dim frm As Form_frmKlantenfiche
Dim Klantennaam, strSQL As String
Set Db = CurrentProject
Klantennaam = InputBox("Which client are you searching for? ")
strSQL = "Select * from frmKlantenfiche where naam_kl=" & Klantennaam
DoCmd.OpenForm "frmKlantenfiche"
Naam_kl.SetFocus
End Sub