Records with un-completed fields

uplink600

Registered User.
Local time
Today, 20:50
Joined
Mar 18, 2004
Messages
69
Good Afternoon Folks

I have a DB where all records are entered using a form in the usual manner. I have a combo box where the user selects an account number and the customer name appears in an adjacent text box. I use the following set up for this.

In cboAccountNumber I have

SELECT DISTINCTROW [Customers].[AccountNumber],[Customers].[CustomerName] FROM [Customers];

In txtCustomerName I have the following in the control source

=cboAccountNumber.Column(1)


This all works fine and the correct customer name is displayed in the required textbox. However, when I close the form and look at the records on the table I find that all fields are completed apart from the CustomerName field as detailed above. The AccountNumber field as selected in cboAccountNumber is completed ok.

Can you advise why these two fields are not being saved please. I know its something to do with the control source but not sure how to solve.

Thanks
 
Box

Try this:

In the After Update Event of the combobox put:

Me.txtCustomerName = cboAccountNumber.Column(1)

And set the data source for txtCustomerName to the appropriate field in the table of query
 
Thanks, That works fine.

One day I will realise that code is the way to do stuff but I'm not to clever with VBA.

Cheers

VC
 

Users who are viewing this thread

Back
Top Bottom