V
vavroom
I'm having a problem with a DlookUp and I can't seem to find a
solution to it. I've searched the board here, and the "web", but
can't seem to get it going. I do hope someone can help.
I am selecting a person's name in a list box. From that name, I want
the appropriate alias to be displayed in a textbox on the same form.
Seems straightforward enough, but it's not quite working.
The data from the list box comes from tblPeople. The data for the
alias comes from a table named [Global Address List]. I cannot modify
the second table. I figured the best way to match was to retrieve the
Last name and First name from tblPeople, and do a dlookup with a
multiple text criteria to provide the relevant Alias. In other words:
lstNameSelect has three columns: fldPeopleID, fldFName and fldLName,
with the first column being bound.
I have one textbox with a dlookup to retrieve the Last Name based on
fldPeopleID, and another to retrieve the First Name. (note, I realise I
*could* build it with the multiple dlookups nested one into another,
but I'm not comfortable with doing this at this point, I don't know
nearly enough. First, get how I want to do it going, then see to
improve!)
Then, I have a textbox with another dlookup that looks like this:
=DLookup("Alias", "[Global Address List]", "[Last]='" &
Forms!frmInfo![txtLName] & "'" And "[First]='" &
Forms!frmInfo![txtFName] & "'")
This invariably returns the first record of the table instead of the
"right" record. What am I doing wrong?
As an aside, I'm working with an address book that has over 5,000
records, and it seems that looking up the info is slower than molasses
in winter. With the info I've provided, can anyone suggest ways to
improve speed?
Thanks in advance for any information and ideas.
solution to it. I've searched the board here, and the "web", but
can't seem to get it going. I do hope someone can help.
I am selecting a person's name in a list box. From that name, I want
the appropriate alias to be displayed in a textbox on the same form.
Seems straightforward enough, but it's not quite working.
The data from the list box comes from tblPeople. The data for the
alias comes from a table named [Global Address List]. I cannot modify
the second table. I figured the best way to match was to retrieve the
Last name and First name from tblPeople, and do a dlookup with a
multiple text criteria to provide the relevant Alias. In other words:
lstNameSelect has three columns: fldPeopleID, fldFName and fldLName,
with the first column being bound.
I have one textbox with a dlookup to retrieve the Last Name based on
fldPeopleID, and another to retrieve the First Name. (note, I realise I
*could* build it with the multiple dlookups nested one into another,
but I'm not comfortable with doing this at this point, I don't know
nearly enough. First, get how I want to do it going, then see to
improve!)
Then, I have a textbox with another dlookup that looks like this:
=DLookup("Alias", "[Global Address List]", "[Last]='" &
Forms!frmInfo![txtLName] & "'" And "[First]='" &
Forms!frmInfo![txtFName] & "'")
This invariably returns the first record of the table instead of the
"right" record. What am I doing wrong?
As an aside, I'm working with an address book that has over 5,000
records, and it seems that looking up the info is slower than molasses
in winter. With the info I've provided, can anyone suggest ways to
improve speed?
Thanks in advance for any information and ideas.