find a name from one table based on a field in another table

  • Thread starter Thread starter Mark Carlyle via AccessMonster.com
  • Start date Start date
M

Mark Carlyle via AccessMonster.com

I have a drop down box that finds the "salesrep name" in my "sales rep list"
with the select query that the drop down makes. It stores the rep number on
the form. I need to do the same lookup but pass the name instead of the rep
number.

the lookup box that gets the name looks like this...

SELECT [Debt Advisors].[Rep Number], [Debt Advisors].[Sales Rep Name] FROM
[Debt Advisors] ORDER BY [Sales Rep Name];

It displays the name but stores the rep number.

I want to use the name for something else. I dont really need to store the
name but do need to use it for another purpose.

How do I do this?
 
If you want the name of the sales rep who has been selected, just read the
..Column(1) property of the combo box:

SalesRepName = Me.ComboBoxName.Column(1)

Otherwise, you can use the DLookup function; check Help for info on how to
use it.
 
Back
Top