Previous Thread

6/15/2006 12:47:02 PM    How do I update a text box using a combo box?
Let me start off by saying I am using Access 2000 and am not a programmer;-) 
 
having said that: 
 
I have two tables:  Mediator and Mediation information.  The Mediator table 
 
has Mediator_Name, Mediator_Phone, and Mediator_Address.  The Mediation table 
 
has 
 
Mediator_Name,  Mediation_Location, and Mediation_Time. 
 
I am using a combo box to list the mediator names and have the work phone 
 
numbers as column 2.  What I am trying to do is have a text box show the 
 
phone number for the mediator chosen from the the combo box. I've tried 
 
putting this in the AfterUpdate in the text box and get a #Name! error: 
 
Me!Mediator_Phone = Me![Mediator_Name].Column(2) 
 
I'm sure the fix is very simple..please help!



6/15/2006 1:14:06 PM    Re: How do I update a text box using a combo box?
Rhoda Harris wrote: 
 
I would use the dlookup function on the form. 
 
example: 
 
Me!Mediator_Phone = DLookup("[Mediator_Phone]" , "Mediator", 
 
"[Mediator_Name] = Forms![FORMNAME]![Mediator_Name]" )

6/15/2006 9:08:44 PM    Re: How do I update a text box using a combo box?
The Column property is zero-based, so Column(0) is the first column, 
 
Column(1) is the second column, and Column(2) would be the third column, 
 
which if I understand correctly does not exist in this instance. 
 
Again, if I understand correctly, I believe this code belongs in the After 
 
Update event of the combo box rather than of the text box - but perhaps that 
 
is what you meant to write? 
 
-- 
 
Brendan Reynolds 
 
Access MVP 
 
"Rhoda Harris" <RhodaHarris@discussions.microsoft.com> wrote in message 
 
news:B975C6E8-9F98-4E37-9528-080C5CFDB2F5@microsoft.com...