A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access97 - Combo box



 
 
Thread Tools Display Modes
  #1  
Old March 20th, 2005, 07:50 AM
Abay
external usenet poster
 
Posts: n/a
Default 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  
Old March 20th, 2005, 07:40 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"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  
Old March 20th, 2005, 08:00 PM
Abay
external usenet poster
 
Posts: n/a
Default


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
combo question rob New Users 10 March 21st, 2005 03:05 PM
Subform Refresh Problem (but only with an unbound combo box control) Barry Skidmore Using Forms 1 December 21st, 2004 02: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


All times are GMT +1. The time now is 12:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.