Problem with command botton

wendy

New member
Local time
Today, 03:54
Joined
Jan 17, 2002
Messages
6
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
 
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
 
Have you solved this problem Wendy? I may be able to help if you haven't

Colin
 

Users who are viewing this thread

Back
Top Bottom