copying value from combobox on one form too text box on another (1 Viewer)

dale_j1992

Registered User.
Local time
Today, 03:33
Joined
Sep 23, 2016
Messages
26
hello i have a small problem i believe someone may be able to help me with :), i am trying too write some Vba to copy the value of a combobox on one form too a text box in my second form. i have some code that does what i want however it copies the autonumber id field (which is collumn 1 in my combobox list, which the width is set to 0 to hide it from view), i want it to copy the value of username which is the second column in the combobox to the textbox on the second open form. any help is greatly appreciated. kind regards
 

MarkK

bit cruncher
Local time
Yesterday, 19:33
Joined
Mar 17, 2004
Messages
8,183
Check out the "Column" Property of the ComboBox control. It takes one required parameter, which is the zero-based index of the column whose value you would like to retrieve, so the second column of the combo can be retrieved with code like...
Code:
debug.print me.cboMyCombo.Column(1)
Hope this helps,
 

dale_j1992

Registered User.
Local time
Today, 03:33
Joined
Sep 23, 2016
Messages
26
Many thanks this worked :)
 

Users who are viewing this thread

Top Bottom