Combo Box (Bound Columns) (1 Viewer)

KSparks

New member
Local time
Today, 10:44
Joined
Oct 26, 1999
Messages
5
I'm not sure how to explain this. I'm having trouble with bound columns in a combo box. I'm using a combo box on a main form that looks up data in a separate lookup table. The combo box has three columns of data that are directly associated with three fields in the lookup table. I have the first coumn of the combo box bound to Field1 in my main form. My question is, how do I also have the second column of the combo box bound to another field (Field2) in my main form? Also, the third column of the combo box bound to another field (Field3) of my main form, etc.?

In other words, I want the combo box, which has three columns of data, to be able to fill in three associated fields in my main form. This works when you have only one bound field, but I can't determine how do get all three columns bound to the appropriate fields in the main form. A separate subform approach won't work because I'm already two-deep with nested forms.

Can anyone help? Thanks in advance.
KSparks
 
P

Paul Eades

Guest
Try putting the following code in the afterupdate module of the combo box.

field2 = combobox.column(1)
field3 = combobox.column(2)

(the bound column in your example would be column 0).

Paul
 

KSparks

New member
Local time
Today, 10:44
Joined
Oct 26, 1999
Messages
5
It worked on the first attempt! Thanks for your help.

KSparks
 

Z1ppy

New member
Local time
Today, 10:44
Joined
Jan 24, 2008
Messages
7
Combo box: forcing more than one column to bind?

I have exactly this problem, but I don't understand how to interpret the syntax; typing my specific fields into the given code.

I have a Combo Box on a Form which looks at 4 columns on a Table which contains data which the user uses to lookup and choose for saving into a Main Table.

I want to bind Column 1 and Column 4 of the Combo box to relevant fields in the Main Table.

I would like help with the following:

I presume this code needs to go in the Combo Box properties under Event - After Update as an [Event Procedure]. Please confirm?

My Combo Box Columns (the lookup table fields) are called Address.fldname and Address.Code. My Main Table Fields are called Client_Address and AddressCode respectively. some help in entering these fields into the code given in the correct syntax would be great. :confused:
 

Z1ppy

New member
Local time
Today, 10:44
Joined
Jan 24, 2008
Messages
7
Ureka!

After a quiet moment away from the PC so away from the problem it dawned on me. Of course you can’t force a Combo Box to bind more than one column to an input Table from a Lookup table – because you don’t need to. To do this would cause a duplication of data in one database which is a waste of space. The old Granny’s Cupboard adage – “one of everything and everything in its place” came to mind.

The solution is to have a unique reference column in the Lookup Table and a Field in the Main Table which stores this reference and then interrogate the data through Queries; which is what RuralGuy was trying to explain – unfortunately to someone inexperienced with the basic principles of databases!

Many thanks – problem solved or at least understood! :rolleyes:
 

Users who are viewing this thread

Top Bottom