Forms![yourFormname]![yourComboboxname].Value

T

Torch

Dear all

Sorry for the stupid question
I got a very good advice, but since I am very noob I can not put it to work.
I haev a button in a form that performs a query.
Th query uses the syntax in the subject as a variable in the query.
However how do I have to write down the the command in SQL in order for SQL
not to recognize it as a string.

I am using the query below, but I know it is wrong because the "" signs make
SQL think it is a string
SELECT [HORA1 rauwe data].ID, [HORA1 rauwe data].DTTM, [HORA1 rauwe
data].Para, [HORA1 rauwe data].Machine, [HORA1 rauwe data].Value, [HORA1
rauwe data].[Lamp ID], [HORA1 rauwe data].Rejection
FROM [HORA1 rauwe data]
WHERE ((([HORA1 rauwe data].Para)="°C M3rild") AND (([HORA1 rauwe
data].Machine)="Forms!Form1!Como3.Value"));
 
S

Stefan Hoffmann

hi Torch,
I got a very good advice, but since I am very noob I can not put it to work.
I haev a button in a form that performs a query.
Don't leave the thread, if your original answer is still open...


mfG
--> stefan <--
 
S

Steven Chicago,Illinois

Dear Torch
data].Machine)="Forms!Form1!Como3.Value"));

=Forms![Torch.Form1]![Como3].value));

Try above

Below is a example of something I use
[Forms]![Comp - Work Table Adds Form]![Comp Acct]

replace Torch.Form1 with the real name of your form
and are you sure your combobox name is Como3 and not Combo03?
Those[ ] are needed. And I am sure the " ", are not needed

But I am not a MVP so if I am off I hope a MVP will correct me.

That should help get you going, also do some searches in the forms coding
and forms area for more examples.
Good Luck,
Steve
 
Top