View Full Version : To select an item


sofie
01-18-2002, 05:47 AM
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

Jack Cowley
01-19-2002, 08:45 AM
If the Code is numberical and not text then try:

strSQL = "Codeklant = " & Code