Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi,

I would like to create a dlookup expression for a field. The field is business unit. this field is getting it's information from table call CostCenter. This table has three column, CostCenterId (primarykey), CostCenter, and BusinessUnitName.

so it looks something like this:
CostCenterId CostCenter BusinessUnitName
1 3418 HR

I want the field to lookup based on the CostCenter and assign the corresponding BusinessUnitName.
So if the user enters 3418 for the CostCenter, then HR should automatically populate in the BusinessUnit field....

Could someone please help me with this one..thanks
 
Hi!

Your can set the control source of the business unit text box to:

=DLookup("BusinessUnitName", "YourTable", "CostCenter = " & Me!YourCostCenterTextBox)

This assumes that CostCenter is a number field. If it isn't then do it like this:

=DLookup("BusinessUnitName", "YourTable", "CostCenter = '" & Me!YourCostCenterTextBox & "'")

hth
Jeff Bridgham
bridgham@purdue.edu
 
Ok something is not working right probably b/c I am not giving you enough information...

I have a form which gets it field from HelpDesk, CostCenter is from this table. When the user goes to create a ticket, and adds the caller name the costcenter is autmatically filled which is obtained from the AddressBooktable. However, I created a CostCenter table that has all the existing costcenter of the company. I want that when the user creates the ticket. The CostCenter which, gets it's information from AddressBookTable, will automatically fill the BusinessUnit field. So the BusinessUnit field is based on the CostCenter.

This is so confusing...hope you could help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top