Linking A Text Box

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

Guest

I'm trying to link a text box with a query I have created, yet I am having no
luck. When I try and do so, the text box shows #Name? rather than the
results of the query. Any ideas on what I'm doing wrong?
 
How are you trying to do it?

You can't put a query as the ControlSource for a text box, although you can
retrieve a value from the resulting recordset for the query using DLookup.
 
Are both the query and field names spelled correcty? For example, does the
space in Question Search exist, or is it just QuestionSearch? Is the query
named Qustion, or is it Question?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
Here's what I was using

=DLookUp("[Question Search]","[Qustion]")


Douglas J Steele said:
How are you trying to do it?

You can't put a query as the ControlSource for a text box, although you can
retrieve a value from the resulting recordset for the query using DLookup.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


having
no
 
The name of the query is Question Search and it is Question (not Qustion - a
mistype) however I am still recieving a Error Message. Would the SQL of the
query be any help in figuring out the problem?

Douglas J Steele said:
Are both the query and field names spelled correcty? For example, does the
space in Question Search exist, or is it just QuestionSearch? Is the query
named Qustion, or is it Question?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
Here's what I was using

=DLookUp("[Question Search]","[Qustion]")


Douglas J Steele said:
How are you trying to do it?

You can't put a query as the ControlSource for a text box, although you can
retrieve a value from the resulting recordset for the query using DLookup.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm trying to link a text box with a query I have created, yet I am having
no
luck. When I try and do so, the text box shows #Name? rather than the
results of the query. Any ideas on what I'm doing wrong?
 
If the query runs successfully, then I doubt that knowing its SQL would
help. (I'm assuming you have run the query successfully...)

What happens if you go the Immediate window (Ctrl-G), type

?DLookUp("[Question Search]","[Question]")

and hit Enter? Do you get the result you expect?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
The name of the query is Question Search and it is Question (not Qustion - a
mistype) however I am still recieving a Error Message. Would the SQL of the
query be any help in figuring out the problem?

Douglas J Steele said:
Are both the query and field names spelled correcty? For example, does the
space in Question Search exist, or is it just QuestionSearch? Is the query
named Qustion, or is it Question?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
Here's what I was using

=DLookUp("[Question Search]","[Qustion]")


:

How are you trying to do it?

You can't put a query as the ControlSource for a text box, although
you
can
retrieve a value from the resulting recordset for the query using DLookup.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm trying to link a text box with a query I have created, yet I
am
having
no
luck. When I try and do so, the text box shows #Name? rather than the
results of the query. Any ideas on what I'm doing wrong?
 
"Run time error '2001':
you canceled the previous operation"

Douglas J Steele said:
If the query runs successfully, then I doubt that knowing its SQL would
help. (I'm assuming you have run the query successfully...)

What happens if you go the Immediate window (Ctrl-G), type

?DLookUp("[Question Search]","[Question]")

and hit Enter? Do you get the result you expect?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
The name of the query is Question Search and it is Question (not Qustion - a
mistype) however I am still recieving a Error Message. Would the SQL of the
query be any help in figuring out the problem?

Douglas J Steele said:
Are both the query and field names spelled correcty? For example, does the
space in Question Search exist, or is it just QuestionSearch? Is the query
named Qustion, or is it Question?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's what I was using

=DLookUp("[Question Search]","[Qustion]")


:

How are you trying to do it?

You can't put a query as the ControlSource for a text box, although you
can
retrieve a value from the resulting recordset for the query using
DLookup.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm trying to link a text box with a query I have created, yet I am
having
no
luck. When I try and do so, the text box shows #Name? rather than the
results of the query. Any ideas on what I'm doing wrong?
 
That cryptic message usually implies that you've mistyped a name in the
DLookup.

I just reread what you said to my question about the names. You said the
name of the query is Question Search. Does that mean you're trying to
retrieve the value of field Question from a query named Question Search? If
so, your syntax is backwards: the field name goes first, followed by the
table or query name, followed by (optionally) a criteria:

DLookUp("[Question]","[Question Search]")


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
"Run time error '2001':
you canceled the previous operation"

Douglas J Steele said:
If the query runs successfully, then I doubt that knowing its SQL would
help. (I'm assuming you have run the query successfully...)

What happens if you go the Immediate window (Ctrl-G), type

?DLookUp("[Question Search]","[Question]")

and hit Enter? Do you get the result you expect?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dave said:
The name of the query is Question Search and it is Question (not
Qustion -
a
mistype) however I am still recieving a Error Message. Would the SQL
of
the
query be any help in figuring out the problem?

:

Are both the query and field names spelled correcty? For example,
does
the
space in Question Search exist, or is it just QuestionSearch? Is the query
named Qustion, or is it Question?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's what I was using

=DLookUp("[Question Search]","[Qustion]")


:

How are you trying to do it?

You can't put a query as the ControlSource for a text box,
although
you
can
retrieve a value from the resulting recordset for the query using
DLookup.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm trying to link a text box with a query I have created, yet
I
am
having
no
luck. When I try and do so, the text box shows #Name? rather
than
the
results of the query. Any ideas on what I'm doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top