Hello,
I have an order form set up that autofills a few fields when the customer's name is selected. I did this using the following On Change code:
Code:
Private Sub Customer_Change()
Me.txtCompany.Value = Me.Customer.Column(2)
Me.txtPhone.Value = Me.Customer.Column(3)
Me.txtEmail.Value = Me.Customer.Column(4)
Me.txtPosition.Value = Me.Customer.Column(5)
It works...kind of. There are two major problems though.
1.) After you initially select the customer it autofills as it should. However when you go to the next record, it keeps that autofilled information there, even if a different customer was already selected in that next record, thus giving it the wrong information.
2.) Once you leave the form and come back, the customer is still selected however the autofill information is gone. Forcing you to reselect the customer to get the autofilled information but then you still have problem #1 to deal with.
I have also tried using the code in After Update with the same results.
The order form is based off a order table, the customer information comes from a customer table. The tables are joined. Otherwise I don't think I'd get any customer information at all.
Anyone have any ideas? Thanks in advance for any input.