View Full Version : Problem with command botton


wendy
01-18-2002, 01:38 AM
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.

can someone say me where I'm wrong.

tnx
xxx


Private Sub cmdsearchonmerk_Click()
Dim Db As CurrentProject
Dim frm As Form_frmresulthardware
Dim trademark, strSQL As String
Set Db = CurrentProject
trademark = InputBox("Which trademark are you searching for? ")
strSQL = "Select * from frmresulthardware where trademark=" & Label3
DoCmd.OpenForm "frmresulthardware"
Label3.SetFocus

Harry
01-18-2002, 02:06 AM
What is label3? Where are you placing the info from the inputbox?

If trademark is the name of the field containg trademark then to save confusion change the variable to TradeReq so something like:

TradeReq = InputBox(".....")
strSQL="Select * from frmresulthardware WHERE [trademark] = '" & TradeReq "';"

I don't know if the Select * from frm... part is correct as I haven't approached froms that way so someone else will have to help if it is wrong.

HTH

EssexColin
01-21-2002, 06:27 AM
Have you solved this problem Wendy? I may be able to help if you haven't

Colin