Passing form data to an sql query

SueAccess

Registered User.
Local time
Today, 16:44
Joined
Jan 22, 2005
Messages
26
I have a hidden field on my form called "key". I can reffer to it as [forms]![MyForm]!key Is that right?

I also have a subform on this form that uses an sql query. I want this query to match on the key from above.

Shouldn't this work? select field1, field2 from table1 where keyvalue = [forms]![MyForm]!key

It doesn't. It returns a blank record.

Any help would be greatly appreciated.
 
Have you verified the value of your hidden field?
Is it numeric or string data?
 

Users who are viewing this thread

Back
Top Bottom