Unknown function 'Dlookup'

L

lord.zoltar

Hello,
I'm trying to set a default value for a column in a table to be based
on values in another table. So far, I've discovered that DLookUp is
the way to go for this sort of thing. The text of my default value
looks like this:
=DLookUp("[value]","rates","[name] = 'Gold'")
and when I try to save, I get an error saying "Unknown Function:
'DLookup'".
and I can't seem to figure out why. Anyone have an idea?
Using Access 2003/WinXP Pro

Thanks.
 
L

lord.zoltar

Hello,
I'm trying to set a default value for a column in a table to be based
on values in another table. So far, I've discovered that DLookUp is
the way to go for this sort of thing. The text of my default value
looks like this:
=DLookUp("[value]","rates","[name] = 'Gold'")
and when I try to save, I get an error saying "Unknown Function:
'DLookup'".
and I can't seem to figure out why. Anyone have an idea?
Using Access 2003/WinXP Pro

Thanks.

Oh, forgot to add:
when I run the above code through the Immediate Window as:
?DLookUp("[value]","rates","[name] = 'Gold'")
it works fine. But it gives the unknown function error when I try to
make it a default value in the table designer.
 
L

lord.zoltar

Hello,
I'm trying to set a default value for a column in a table to be based
on values in another table. So far, I've discovered that DLookUp is
the way to go for this sort of thing. The text of my default value
looks like this:
=DLookUp("[value]","rates","[name] = 'Gold'")
and when I try to save, I get an error saying "Unknown Function:
'DLookup'".
and I can't seem to figure out why. Anyone have an idea?
Using Access 2003/WinXP Pro

Thanks.

Ok I got a work-around:

I put the above code into the default value for the fields on the Form
rather than on the table. It works but it's not great.
still, does anyone know why that code didn't work on the table?
 
F

fredg

Hello,
I'm trying to set a default value for a column in a table to be based
on values in another table. So far, I've discovered that DLookUp is
the way to go for this sort of thing. The text of my default value
looks like this:
=DLookUp("[value]","rates","[name] = 'Gold'")
and when I try to save, I get an error saying "Unknown Function:
'DLookup'".
and I can't seem to figure out why. Anyone have an idea?
Using Access 2003/WinXP Pro

Thanks.

1) Change the Value and Name field names to something else.
Name and Value are both reserved Access/VBA/Jet words and should not
be used as field names.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html

2) After you change the field names to something else, use the
appropriate control's defaultvalue property on the FORM.
Don't use the field's defaultvalue property in the table.
 
L

lord.zoltar

1) Change the Value and Name field names to something else.
Name and Value are both reserved Access/VBA/Jet words and should not
be used as field names.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

For an even more complete list of reserved words, see:http://www.allenbrowne.com/AppIssueBadWord.html

Thanks for the warning! I'll have a look.
 
G

George Nicholson

You can't use functions as default values for fields in table design. The
exception to that are a few simple system calls (which require no arguments)
like Date() and Now().

HTH,



Hello,
I'm trying to set a default value for a column in a table to be based
on values in another table. So far, I've discovered that DLookUp is
the way to go for this sort of thing. The text of my default value
looks like this:
=DLookUp("[value]","rates","[name] = 'Gold'")
and when I try to save, I get an error saying "Unknown Function:
'DLookup'".
and I can't seem to figure out why. Anyone have an idea?
Using Access 2003/WinXP Pro

Thanks.

Ok I got a work-around:

I put the above code into the default value for the fields on the Form
rather than on the table. It works but it's not great.
still, does anyone know why that code didn't work on the table?
 
A

aaron.kempf

I can use functions for defaults using Access Data Projects



I do it ALL THE FRIGGIN TIME





You can't use functions as default values for fields in table design. The
exception to that are a few simple system calls (which require no arguments)
like Date() and Now().

HTH,


Hello,
I'm trying to set a default value for a column in a table to be based
on values in another table. So far, I've discovered that DLookUp is
the way to go for this sort of thing. The text of my default value
looks like this:
=DLookUp("[value]","rates","[name] = 'Gold'")
and when I try to save, I get an error saying "Unknown Function:
'DLookup'".
and I can't seem to figure out why. Anyone have an idea?
Using Access 2003/WinXP Pro
Thanks.
Ok I got a work-around:
I put the above code into the default value for the fields on the Form
rather than on the table. It works but it's not great.
still, does anyone know why that code didn't work on the table?
 

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

Similar Threads

Dlookup error 4
Dlookup? 5
DLookUp 7
Trouble with DLookup 3
Compare function values 5
dlookup 1
dlookup problem 2
DLookup Function 2

Top