If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access97 - Combo box
I have a form for a client table which takes info from a property table, the
link being property name in both tables. I would like to set up a combo box which enters both the property name and a commission value from the property table into the client table .. i.e. enter both values displayed on the two columns of the combo box. I created a combo box with the wizard and when I key part of the property name I can select the correct row, I can get it to enter one or other of the values but not both .. egg .. I get a drop down list of both property names, and commissions, and when a particular row is selected the commission field is updated in the client table. I would like both the property name and the commission value to update the client table. Note: the property name is the key in the property table. This is probably really dumb question & I apologise.. I have some reference books (a bit of a newbie),and am teaching myself access, but can't seem to find the answer sigh Any help would be much appreciated. abay |
#2
|
|||
|
|||
"Abay" wrote in message
I have a form for a client table which takes info from a property table, the link being property name in both tables. I would like to set up a combo box which enters both the property name and a commission value from the property table into the client table .. i.e. enter both values displayed on the two columns of the combo box. I created a combo box with the wizard and when I key part of the property name I can select the correct row, I can get it to enter one or other of the values but not both .. egg .. I get a drop down list of both property names, and commissions, and when a particular row is selected the commission field is updated in the client table. I would like both the property name and the commission value to update the client table. Note: the property name is the key in the property table. This is probably really dumb question & I apologise.. I have some reference books (a bit of a newbie),and am teaching myself access, but can't seem to find the answer sigh Any help would be much appreciated. abay A combo box can have only one "bound column"; that is, only one of its columns can be the one that constitutes the value of the control, and hence is automatically stored in the field (if any) to which the combo box is bound. But you can use code to pick up the value from a different column and stick it into some other field. For example, if your combo is named and bound to "PropertyName", with columns "PropertyName" and "Commission", then you could use code in the combo's AfterUpdate event to get the commission from the second column and put it in the form's Commission field: '----- start of example code ----- Private Sub PropertyName_AfterUpdate() Me!Commission = Me!PropertyName.Column(1) End Sub '----- end of example code ----- Note that the second column of the combo box is .Column(1), because the columns are numbered from 0. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#3
|
|||
|
|||
That worked like a charm .. many thanks .. much appreciated. abay "Dirk Goldgar" wrote in message ... "Abay" wrote in message I have a form for a client table which takes info from a property table, the link being property name in both tables. I would like to set up a combo box which enters both the property name and a commission value from the property table into the client table .. i.e. enter both values displayed on the two columns of the combo box. I created a combo box with the wizard and when I key part of the property name I can select the correct row, I can get it to enter one or other of the values but not both .. egg .. I get a drop down list of both property names, and commissions, and when a particular row is selected the commission field is updated in the client table. I would like both the property name and the commission value to update the client table. Note: the property name is the key in the property table. This is probably really dumb question & I apologise.. I have some reference books (a bit of a newbie),and am teaching myself access, but can't seem to find the answer sigh Any help would be much appreciated. abay A combo box can have only one "bound column"; that is, only one of its columns can be the one that constitutes the value of the control, and hence is automatically stored in the field (if any) to which the combo box is bound. But you can use code to pick up the value from a different column and stick it into some other field. For example, if your combo is named and bound to "PropertyName", with columns "PropertyName" and "Commission", then you could use code in the combo's AfterUpdate event to get the commission from the second column and put it in the form's Commission field: '----- start of example code ----- Private Sub PropertyName_AfterUpdate() Me!Commission = Me!PropertyName.Column(1) End Sub '----- end of example code ----- Note that the second column of the combo box is .Column(1), because the columns are numbered from 0. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
combo question | rob | New Users | 10 | March 21st, 2005 02:05 PM |
Subform Refresh Problem (but only with an unbound combo box control) | Barry Skidmore | Using Forms | 1 | December 21st, 2004 01:19 AM |
combo box with query as data source | Simon Wong | Using Forms | 2 | October 14th, 2004 10:13 AM |
Combo Box Problem | Charles | Using Forms | 0 | May 28th, 2004 09:15 PM |
Requery Combobox | MJ | Running & Setting Up Queries | 7 | May 25th, 2004 11:01 AM |