Help with Dlookup Syntax


R

Robin

Hi
I'm getting error #Name with this syntax

=DLookup([FULLNALME]![NationalTechNumber],"[Tech1]="&[Forms]!
[tblCheckInstall],[Tech1])

where FULLNAME is a query. Tech1 is a combo box displaying techs
FullName from the query. Where I want the new text box to display the
techs id number (text field) based on the name selected in tech1. The
form is tblCheckInstall.

Thanks
 
Ad

Advertisements

R

Robin

 =DLookup("[NationalTechNumber]","[FULLNAME]","[Tech1]=" &
[Forms]![tblCheckInstall].[Tech1])
or
 =DLookup("[NationalTechNumber]","[FULLNAME]","[Tech1]=" & [Tech1])

The format is "field you want to display", "table or query", "field in table
or query to test = " & some value on form)

Damon




Hi
I'm getting error #Name with this syntax
=DLookup([FULLNALME]![NationalTechNumber],"[Tech1]="&[Forms]!
[tblCheckInstall],[Tech1])

where FULLNAME is a query.  Tech1 is a combo box displaying techs
FullName from the query.  Where I want the new text box to display the
techs id number (text field) based on the name selected in tech1.  The
form is tblCheckInstall.
Thanks- Hide quoted text -

- Show quoted text -

Thanks, but now I am getting #Error.

The "field in table I want to check" is actually Named "Full NAme"

So the Syntax I am now using is:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]=" & [Tech1])
 
K

Klatuu

It sounds line [Full Name] is a text field. Your syntax is for a numeric
field. For a text field it would be:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]= """ & [Tech1]) &
""""


--
Dave Hargis, Microsoft Access MVP


Robin said:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Tech1]=" &
[Forms]![tblCheckInstall].[Tech1])
or
=DLookup("[NationalTechNumber]","[FULLNAME]","[Tech1]=" & [Tech1])

The format is "field you want to display", "table or query", "field in table
or query to test = " & some value on form)

Damon




Hi
I'm getting error #Name with this syntax
=DLookup([FULLNALME]![NationalTechNumber],"[Tech1]="&[Forms]!
[tblCheckInstall],[Tech1])

where FULLNAME is a query. Tech1 is a combo box displaying techs
FullName from the query. Where I want the new text box to display the
techs id number (text field) based on the name selected in tech1. The
form is tblCheckInstall.
Thanks- Hide quoted text -

- Show quoted text -

Thanks, but now I am getting #Error.

The "field in table I want to check" is actually Named "Full NAme"

So the Syntax I am now using is:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]=" & [Tech1])
 
R

Robin

It sounds line [Full Name] is a text field.  Your syntax is for a numeric
field.  For a text field it would be:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]= """ & [Tech1]) &
""""

--
Dave Hargis, Microsoft Access MVP



Robin said:
 =DLookup("[NationalTechNumber]","[FULLNAME]","[Tech1]=" &
[Forms]![tblCheckInstall].[Tech1])
or
 =DLookup("[NationalTechNumber]","[FULLNAME]","[Tech1]=" & [Tech1])
The format is "field you want to display", "table or query", "field in table
or query to test = " & some value on form)
Damon

Hi
I'm getting error #Name with this syntax
=DLookup([FULLNALME]![NationalTechNumber],"[Tech1]="&[Forms]!
[tblCheckInstall],[Tech1])
where FULLNAME is a query.  Tech1 is a combo box displaying techs
FullName from the query.  Where I want the new text box to display the
techs id number (text field) based on the name selected in tech1.  The
form is tblCheckInstall.
Thanks- Hide quoted text -
- Show quoted text -
Thanks, but now I am getting #Error.
The "field in table I want to check" is actually Named "Full NAme"
So the Syntax I am now using is:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]=" & [Tech1])- Hide quoted text -

- Show quoted text -

Yes it is a text field. But could you write out what all the quotes
are? Is it double double double &[Tech1])& double double double
double? My eyes are tired, and I'm doing this on a dual boot mac- cut
and paste isn't working so hot.
 
R

Robin

using this version: =DLookup("NationalTechNumber", "FULLNAME",
"[Tech1] = """ & [Forms]![tblCheckInstall],[Tech1] & """")

And I get the error: You are using the wrong number of arguments. I
was able to cut and paste.

Using this Version:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]= """ &
[Tech1]) &
""""
I get invalid syntax, use of an operator without an operand.
 
Ad

Advertisements

K

Klatuu

Doh!
Yeah, sorry about that.
--
Dave Hargis, Microsoft Access MVP


Damon Heron said:
Use this Version with the closing parens:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]= """ &
[Tech1] & """")

Robin said:
using this version: =DLookup("NationalTechNumber", "FULLNAME",
"[Tech1] = """ & [Forms]![tblCheckInstall],[Tech1] & """")

And I get the error: You are using the wrong number of arguments. I
was able to cut and paste.

Using this Version:
=DLookup("[NationalTechNumber]","[FULLNAME]","[Full NAme]= """ &
[Tech1]) &
""""
I get invalid syntax, use of an operator without an operand.
 

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

Top