Welcome to SPN

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

Sign Up Now!

#Name? error on text box control in Access 2003 form

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

  1. mtnlvr

    mtnlvr
    Expand Collapse
    Guest

    I have a text control on a form whose control source is the following query
    which is named qryPrimaryEmbossing2:

    SELECT sEmbossing
    FROM tblPrimaryEmbossing
    WHERE iEmbossingIndex=Forms!frmMyInsulators![Embossing Variation]
    And iCD=Forms!frmMyInsulators!CD;

    It is meant to look up the text string sEmbossing using the the [Embossing
    Variation] and CD numbers on the form.

    If the form is open and I run the query (manually), it always returns the
    correct results.

    I have looked at all of the entries in help for the #Name? error and don't
    see any that apply to my tables and form.
    The query name in the control source for the text box is spelled correctly,
    has no leading spaces and has an "=" i.e.,
    =[qryPrimaryEmbossing2]![sEmbossing]
    There are no duplicate field names in the underlying tables.

    Can someone please give me some other ideas to fix this? I have run out of
    ideas.

    Thanks
     
  2. Loading...


  3. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    Use DlookUp to return a value from the query

    =DlookUp("sEmbossing","qryPrimaryEmbossing2")

    --
    Good Luck
    BS"D


    "mtnlvr" wrote:

    > I have a text control on a form whose control source is the following query
    > which is named qryPrimaryEmbossing2:
    >
    > SELECT sEmbossing
    > FROM tblPrimaryEmbossing
    > WHERE iEmbossingIndex=Forms!frmMyInsulators![Embossing Variation]
    > And iCD=Forms!frmMyInsulators!CD;
    >
    > It is meant to look up the text string sEmbossing using the the [Embossing
    > Variation] and CD numbers on the form.
    >
    > If the form is open and I run the query (manually), it always returns the
    > correct results.
    >
    > I have looked at all of the entries in help for the #Name? error and don't
    > see any that apply to my tables and form.
    > The query name in the control source for the text box is spelled correctly,
    > has no leading spaces and has an "=" i.e.,
    > =[qryPrimaryEmbossing2]![sEmbossing]
    > There are no duplicate field names in the underlying tables.
    >
    > Can someone please give me some other ideas to fix this? I have run out of
    > ideas.
    >
    > Thanks
    >
     
  4. mtnlvr

    mtnlvr
    Expand Collapse
    Guest

    Thank you Ofer - that works!

    "Ofer Cohen" wrote:

    > Use DlookUp to return a value from the query
    >
    > =DlookUp("sEmbossing","qryPrimaryEmbossing2")
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "mtnlvr" wrote:
    >
    > > I have a text control on a form whose control source is the following query
    > > which is named qryPrimaryEmbossing2:
    > >
    > > SELECT sEmbossing
    > > FROM tblPrimaryEmbossing
    > > WHERE iEmbossingIndex=Forms!frmMyInsulators![Embossing Variation]
    > > And iCD=Forms!frmMyInsulators!CD;
    > >
    > > It is meant to look up the text string sEmbossing using the the [Embossing
    > > Variation] and CD numbers on the form.
    > >
    > > If the form is open and I run the query (manually), it always returns the
    > > correct results.
    > >
    > > I have looked at all of the entries in help for the #Name? error and don't
    > > see any that apply to my tables and form.
    > > The query name in the control source for the text box is spelled correctly,
    > > has no leading spaces and has an "=" i.e.,
    > > =[qryPrimaryEmbossing2]![sEmbossing]
    > > There are no duplicate field names in the underlying tables.
    > >
    > > Can someone please give me some other ideas to fix this? I have run out of
    > > ideas.
    > >
    > > Thanks
    > >
     

Share This Page