Auto Fill code not working

  • Thread starter Thread starter zonk2439
  • Start date Start date
Z

zonk2439

I am using the below code to auto fill two fields. However I can never get
column 2 to fill. I can switch the Phone and Email order and only column 1
will always populate but never colunm 2? Any idea why?

Private Sub Contact_AfterUpdate()
Me.Contact = Me.Contact.Column(0)
Me.Phone = Me.Contact.Column(1)
Me.Email = Me.Contact.Column(2)

Thanks in advance!!
 
Linq Adams via AccessMonster.com said:
What exactly are you trying to do with this line:

Me.Contact = Me.Contact.Column(0)

You appear to be trying to assign the combobox' value to itself, which may be
confusing Access. Try just using

Me.Phone = Me.Contact.Column(1)
Me.Email = Me.Contact.Column(2)

I tried removing the line Me.Contact = Me.Contact.Column(0) and get the same
results. When I run the query that this is based off of it does return all
three rows.
I just can't get that third field to populate.

Thanks.
 
Is the ColumnCount property set correctly? If it's only set to 1 or 2, you
won't be able to refer to Column(2)
 
Back
Top