Dlookup #error #name

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

Guest

I have a form with a tab control which houses 3 subforms. On one of the
subforms I have a combo box from which I pick an id number. The field beside
it has a dlookup function that should return a description based on the combo
but I can't seem to get it to work. I have an ADP front end to sql2005
backend. I have tried the following:

=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] =
[comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] =" & forms![comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] = " &
forms![subform].form![comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] = form.[comboname]")


HELP!
 
The objects you are referencing to get the values to pass have to be outside
the quotes. It is also necessary to delimit the value being passed based on
the data type of the domain field:

Numeric version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = " &
[comboname])

Text version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = '" &
[comboname]) & "'"

Date version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = #" &
[comboname]) & "#"
 
Thank you. I used your text version but moved the ending quotes inside the
bracket.


--
Shelley


Klatuu said:
The objects you are referencing to get the values to pass have to be outside
the quotes. It is also necessary to delimit the value being passed based on
the data type of the domain field:

Numeric version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = " &
[comboname])

Text version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = '" &
[comboname]) & "'"

Date version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = #" &
[comboname]) & "#"


Dazzle said:
I have a form with a tab control which houses 3 subforms. On one of the
subforms I have a combo box from which I pick an id number. The field beside
it has a dlookup function that should return a description based on the combo
but I can't seem to get it to work. I have an ADP front end to sql2005
backend. I have tried the following:

=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] =
[comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] =" & forms![comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] = " &
forms![subform].form![comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] = form.[comboname]")


HELP!
 
oops!
correct syntax does make a difference :)

Dazzle said:
Thank you. I used your text version but moved the ending quotes inside the
bracket.


--
Shelley


Klatuu said:
The objects you are referencing to get the values to pass have to be outside
the quotes. It is also necessary to delimit the value being passed based on
the data type of the domain field:

Numeric version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = " &
[comboname])

Text version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = '" &
[comboname]) & "'"

Date version:
=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] = #" &
[comboname]) & "#"


Dazzle said:
I have a form with a tab control which houses 3 subforms. On one of the
subforms I have a combo box from which I pick an id number. The field beside
it has a dlookup function that should return a description based on the combo
but I can't seem to get it to work. I have an ADP front end to sql2005
backend. I have tried the following:

=dlookup("[description]", "tabletolookin", "[Fieldinlookuptable] =
[comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] =" & forms![comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] = " &
forms![subform].form![comboname]")
=dlookup("[description]", "tabletolookin", "[filtbl] = form.[comboname]")


HELP!
 
Back
Top