Pull Query Criteria from a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I know this is posted previously but I am having an issue. Here is my query:

SELECT t_main.*, *
FROM t_main
WHERE (((t_main.last_name)=Forms![f_search]![tlastname])) OR
(((t_main.ssn)=[Enter the Last Name or SSN you wish to search for:]));

However, when I do this I am prompted to enter a value for
Forms![f_search]![tlastname], and I believe it should pull the value from
this textbox or actually I think it should open the form. Can someone let me
know what I am doing wrong?
 
A query will not force a form to open. You must open the form prior to
running the query.
 
Thanks Duane. That helped.
--
Thank You,
Steve


Duane Hookom said:
A query will not force a form to open. You must open the form prior to
running the query.

--
Duane Hookom
MS Access MVP
--

Steve D said:
Hi,
I know this is posted previously but I am having an issue. Here is my
query:

SELECT t_main.*, *
FROM t_main
WHERE (((t_main.last_name)=Forms![f_search]![tlastname])) OR
(((t_main.ssn)=[Enter the Last Name or SSN you wish to search for:]));

However, when I do this I am prompted to enter a value for
Forms![f_search]![tlastname], and I believe it should pull the value from
this textbox or actually I think it should open the form. Can someone let
me
know what I am doing wrong?
 
Back
Top