Dlookup Question

J

John

Hello to everybody,

I have a table called "Tbl_CboFamilyName" with
-FamilyNameID (pk)
- FamilyName
- ExpireDate
that I use to popolate a combobox "CboFamilyName" in a form called "Classes"
In the same form "Classes" I have a text box named "ExpireDate".
I would like to see the ExpireDate in the appropriate field when I choose
the name in the combo.
Is that possible?
I am trying the DLookup function place in the "ExpireData" (doesn't work)
=DLookUp("ExpireDate";"Tbl_CboFamilyName";"CboFamilyName")

Thanks in advance for your help.
Kind regards
John
 
T

tina

just include the ExpireDate field in the combo box's RowSource, as

SELECT * FROM Tbl_CboFamilyName ORDER BY FamilyName;

and set the ColumnWidths property to hide all but the FamilyName column, as

0"; 1"; 0"

then set the ControlSource property of of the txtExpireDate control to

=[ComboBoxControlName].[Column](2)

hth
 
B

Bill (Unique as my name)

It will help to use commas instead of semicolons between the quotations
marks in the dlookup statement.
 
S

Steve Schapel

Bill,

This is true in the US. In many versions of Access, the ; is the
correct delimiter. By John's email address, I would assume he is
perhaps using an Italian version.
 
J

John

Yes, you are right.
I am using the Italian version. And believe sometimes to use the commas or
semicolons make me "crazy".

Thanks for all your support.
Regards
John
 
B

Bill (Unique as my name)

Oops!

Steve said:
Bill,

This is true in the US. In many versions of Access, the ; is the
correct delimiter. By John's email address, I would assume he is
perhaps using an Italian version.
 
Top