Push values to Text Box

kidzmom3

Member
Local time
Today, 21:38
Joined
Jan 25, 2002
Messages
39
I have a combo box (CustID) w/3 columns (CustID, Customer, Phone, col. 1 is bound. I want col.3 to fill in the bound txtPhone box on my form after choosing the CustID. Here's my present code which always returns a null value:

Private Sub CustID_AfterUpdate()

Me!txtPhone = Me!CustID.Column(3)

End Sub

I know I'm missing something simple! Thanks for the help!!!!!
smile.gif
 
try Me!txtPhone = Me!CustID.Column(2)
The first field in the combo box is (0)
 
Thx, tried that already . . . any other suggestions ? ? ? ?
frown.gif
 
I am assuming you have the Row Source Type for this Combo Box filled in with Table/Query and then in the Row Source property:

SELECT [QueryName].[CustID],[QueryName].[Customer],[QueryName].[Phone] FROM [QueryName];

Then in the AfterUpdate Event of Combo Box:
Me![Phone] = Me![Phone].Column.(2)


I'm wonderding if the fact that your ComboBox name is CustID and your 1st field name is CustID also may have some effect?

Also make sure your properties are defined for your ComboBox (Bound Column = 1, Column Count = 3, etc.)

HTH
 

Users who are viewing this thread

Back
Top Bottom