Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Linking A Text Box

Discussion in 'Information Technology' started by Dave, Jul 28, 2006.

Tags:
  1. Dave

    Dave
    Expand Collapse
    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?
     
  2. Loading...


  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    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
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Dave" <Dave@discussions.microsoft.com> wrote in message
    news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > 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?
     
  4. Dave

    Dave
    Expand Collapse
    Guest

    Here's what I was using

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


    "Douglas J Steele" wrote:

    > 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
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > > 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?

    >
    >
    >
     
  5. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    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
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Dave" <Dave@discussions.microsoft.com> wrote in message
    news:8EAC3233-4550-4099-9A1A-D26CA561C6B4@microsoft.com...
    > Here's what I was using
    >
    > =DLookUp("[Question Search]","[Qustion]")
    >
    >
    > "Douglas J Steele" wrote:
    >
    > > 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
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > > > 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?

    > >
    > >
    > >
     
  6. Dave

    Dave
    Expand Collapse
    Guest

    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" wrote:

    > 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
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > news:8EAC3233-4550-4099-9A1A-D26CA561C6B4@microsoft.com...
    > > Here's what I was using
    > >
    > > =DLookUp("[Question Search]","[Qustion]")
    > >
    > >
    > > "Douglas J Steele" wrote:
    > >
    > > > 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
    > > > http://I.Am/DougSteele
    > > > (no e-mails, please!)
    > > >
    > > >
    > > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > > news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > > > > 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?
    > > >
    > > >
    > > >

    >
    >
    >
     
  7. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    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
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Dave" <Dave@discussions.microsoft.com> wrote in message
    news:4E408883-CA2D-4B3A-B9AF-ECAF265D3DCF@microsoft.com...
    > 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" wrote:
    >
    > > 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
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > news:8EAC3233-4550-4099-9A1A-D26CA561C6B4@microsoft.com...
    > > > Here's what I was using
    > > >
    > > > =DLookUp("[Question Search]","[Qustion]")
    > > >
    > > >
    > > > "Douglas J Steele" wrote:
    > > >
    > > > > 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
    > > > > http://I.Am/DougSteele
    > > > > (no e-mails, please!)
    > > > >
    > > > >
    > > > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > > > news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > > > > > 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?
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >
     
  8. Dave

    Dave
    Expand Collapse
    Guest

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

    "Douglas J Steele" wrote:

    > 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
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > news:4E408883-CA2D-4B3A-B9AF-ECAF265D3DCF@microsoft.com...
    > > 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" wrote:
    > >
    > > > 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
    > > > http://I.Am/DougSteele
    > > > (no e-mails, please!)
    > > >
    > > >
    > > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > > news:8EAC3233-4550-4099-9A1A-D26CA561C6B4@microsoft.com...
    > > > > Here's what I was using
    > > > >
    > > > > =DLookUp("[Question Search]","[Qustion]")
    > > > >
    > > > >
    > > > > "Douglas J Steele" wrote:
    > > > >
    > > > > > 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
    > > > > > http://I.Am/DougSteele
    > > > > > (no e-mails, please!)
    > > > > >
    > > > > >
    > > > > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > > > > news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > > > > > > 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?
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >
    > > >

    >
    >
    >
     
  9. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    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
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Dave" <Dave@discussions.microsoft.com> wrote in message
    news:D7431676-F339-4F88-AC08-728CE8694721@microsoft.com...
    > "Run time error '2001':
    > you canceled the previous operation"
    >
    > "Douglas J Steele" wrote:
    >
    > > 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
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > news:4E408883-CA2D-4B3A-B9AF-ECAF265D3DCF@microsoft.com...
    > > > 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" wrote:
    > > >
    > > > > 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
    > > > > http://I.Am/DougSteele
    > > > > (no e-mails, please!)
    > > > >
    > > > >
    > > > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > > > news:8EAC3233-4550-4099-9A1A-D26CA561C6B4@microsoft.com...
    > > > > > Here's what I was using
    > > > > >
    > > > > > =DLookUp("[Question Search]","[Qustion]")
    > > > > >
    > > > > >
    > > > > > "Douglas J Steele" wrote:
    > > > > >
    > > > > > > 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
    > > > > > > http://I.Am/DougSteele
    > > > > > > (no e-mails, please!)
    > > > > > >
    > > > > > >
    > > > > > > "Dave" <Dave@discussions.microsoft.com> wrote in message
    > > > > > > news:75C268DD-9087-4BD9-AFDF-B79731249F1E@microsoft.com...
    > > > > > > > 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?
    > > > > > >
    > > > > > >
    > > > > > >
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >
     

Share This Page