View Full Version : Visual Basic, customizing a combo box


nh1234
12-27-2005, 11:23 AM
Hi,

Is there a simple way in visual basic to customize a combo box to update more than one field on a form? Creating a combo box using the wizard only allows for the update of one field. I tried the following VB code:

Me.name = Me.Combo59.column(1)
Me.ID = Me.Combo59.column(2)

It only recognizes the name column and won't populate the ID. Any ideas?

edtab
12-27-2005, 03:08 PM
If your combo box has two columns (Name and ID), usually
ID comes first before the name. In this case, you would
refer to your ID as Me.Combo.Column(0) and to the Name
as Me.Combo.Column(1).

Combo field columns start with a base of "0", not "1".

Not sure if this is your problem, but without seeing your db,
I am guessing it is.

Hope this helps.

nh1234
12-28-2005, 11:56 AM
Thanks that was very helpful.


If your combo box has two columns (Name and ID), usually
ID comes first before the name. In this case, you would
refer to your ID as Me.Combo.Column(0) and to the Name
as Me.Combo.Column(1).

Combo field columns start with a base of "0", not "1".

Not sure if this is your problem, but without seeing your db,
I am guessing it is.

Hope this helps.