To select an item

sofie

Registered User.
Local time
Today, 15:30
Joined
Jan 17, 2002
Messages
12
If I click on "cmd_edit" I would like to receive the information of 1 client of the frmKlantenfiche.

With the following code, he gives me an error in :

DoCmd.OpenForm "frmKlantenfiche", , , strSQL

What do I have to do, or what am I doing wrong?

Private Sub cmdEdit_Click()
Dim Db As CurrentProject
Dim frm As Form_frmKlantenfiche
Dim Code, strSQL As String
Set Db = CurrentProject
Code = InputBox("Wich information would you like to edit?(Code client) ")
If Code = "" Then
DoCmd.OpenForm "frmAlleKlanten"
DoCmd.Close acForm, "frmKlantenfiche"
Exit Sub
End If
strSQL = "Codeklant='" & Code & "'"
DoCmd.OpenForm "frmKlantenfiche", , , strSQL
Forms!frmKlantenfiche!Codeklant.SetFocus
End Sub


Sofie

Tnx
 
If the Code is numberical and not text then try:

strSQL = "Codeklant = " & Code
 

Users who are viewing this thread

Back
Top Bottom