K
Karen
I have a subform with a combo box which has a source of Company Names and Company ID's
Col 1 Col 2
CompanyID CompanyName
1 Home Depot
2 Lowe's
When I select a company name from the combo box I want to store the company ID in a textbox on the subform which is named txtCompanyID. My code is:
txtCompanyID.Value = Me!cboCompanyName.Column(0)
and I have this code attached to the combobox's 'AfterUpdate' event.
I get an error 'You can't assign a value to this object'. I just don't understand why this would be a problem. Because I can't get this to work I keep adding the same company over and over again when what I want to do is knowing which company I can fill other fields on the subform with the company data. Any help on this would be appreciated.
Col 1 Col 2
CompanyID CompanyName
1 Home Depot
2 Lowe's
When I select a company name from the combo box I want to store the company ID in a textbox on the subform which is named txtCompanyID. My code is:
txtCompanyID.Value = Me!cboCompanyName.Column(0)
and I have this code attached to the combobox's 'AfterUpdate' event.
I get an error 'You can't assign a value to this object'. I just don't understand why this would be a problem. Because I can't get this to work I keep adding the same company over and over again when what I want to do is knowing which company I can fill other fields on the subform with the company data. Any help on this would be appreciated.