DLookup

  • Thread starter Thread starter Nigel Bate
  • Start date Start date
N

Nigel Bate

I have a form (Access 2000) with store info on the top half and area info on
the bottom - not necessarily related.
I need to use a DLookup on the bottom half to follow the top. I have the
code for finding numbers, but what changes do I need to make to it if I use
text e.g. T120 in a text field.

Many thanks for any help in advance

Nigel
 
Hello Nigel.

Nigel said:
I have a form (Access 2000) with store info on the top half and
area info on the bottom - not necessarily related.
I need to use a DLookup on the bottom half to follow the top. I
have the code for finding numbers, but what changes do I need to
make to it if I use text e.g. T120 in a text field.

Are you sure that you want to use the DLookup function? It's so slow.
Try to find an alternative writing a new faster lookup funciton.
I guess the answer to your question is: use quotation marks (for
convenience use single quotation marks, for example like this:
=DLookup("[MyField]","MyTable","[aTextField]='" & [aTextBox] & "'")
 
Wolfgang,
Many Thanks, I'll give it a try

Nigel
Wolfgang Kais said:
Hello Nigel.

Nigel said:
I have a form (Access 2000) with store info on the top half and
area info on the bottom - not necessarily related.
I need to use a DLookup on the bottom half to follow the top. I
have the code for finding numbers, but what changes do I need to
make to it if I use text e.g. T120 in a text field.

Are you sure that you want to use the DLookup function? It's so slow.
Try to find an alternative writing a new faster lookup funciton.
I guess the answer to your question is: use quotation marks (for
convenience use single quotation marks, for example like this:
=DLookup("[MyField]","MyTable","[aTextField]='" & [aTextBox] & "'")
 
Back
Top