Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2004, 08:41 AM
Authorized User
 
Join Date: Apr 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lguzman
Default Need help...

Hi.

In a sub-form, I want to display the names of companies. However the fields that are part of the table that is linked to the form, only holds the company's ID number. What I would like to display is held in another table where the ID, Company name and main contact are held.

At the moment I have the following in a textbox:

=DLookUp([sname],[TblAccountingBillToDropDownInfo],[FrmAccountingBillToDisplay].[AccountingBillToC]=[lID])


*************
[u]Legend</u>

sname = Is the field holding the Company name in the table holding
ID, Company Name and Main Contact

TblAccountingBill...Info = Is the said table

FrmAccounting...Display = Is the sub-form in which I wish to display

AccountingBillToC = Holds the Company ID I wish to look for

lID= the field in TblAccountingBill...Info which holds the company's IDs
*************


however this only displays #Name on the field.


Please Help.


Thanks.


LG
__________________
[LGuzman]
 
Old April 27th, 2004, 09:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Good morning,
If I understand your question correctly, this should work:
In the design view of the form, go to the properties of the text box that you want the list in and click on the build icon next to "Row Source" property. This will bring up a screen for a SQL builder that looks like a query design view. Then only add the field of the Company name or what ever you want in the list for that field. That way it grabs that field and not the ID field.

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old April 27th, 2004, 12:57 PM
Authorized User
 
Join Date: Apr 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lguzman
Default

Thank you for your help. Your advice pointed me to the solution.

LG

[LGuzman]









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.