Dlookup Question

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
 
It will help to use commas instead of semicolons between the quotations
marks in the dlookup statement.
 
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.
 
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
 
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.
 

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

Conditional Formating and SetFocus Question 4
AutoFill Records 2
Using Dlookup in form - New to Access 3
Nesting DLOOKUPs 4
Dlookup problem 6
Dlookup Question 5
DLookup Expression trouble 5
dlookup question 1

Back
Top