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  

how can I populate a field with a combo box with duplicate values



 
 
Thread Tools Display Modes
  #1  
Old April 17th, 2006, 10:34 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate values

My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks
  #2  
Old April 18th, 2006, 12:05 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate values

I sounds like you are trying to select two types of criteria from the same
ComboBox. You can do that if you use a third field so the combination of the
two criteria use a unique number/character set in the third field.

You should use a separate ComboBox for each selection criteria.

"walkbyfaith7" wrote:

My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks

  #3  
Old April 18th, 2006, 12:13 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate values

walkbyfaith7,
You'll need to add a key field to the underlying table upon which your combo is based.
AdjustmentType is not discreet or unique enough to define which OutputType you are
selecting.
Each record should have it's own unique identifier value, and the combo should select
by that value, not by the dupe fields.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"walkbyfaith7" wrote in message
...
My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks



  #4  
Old April 18th, 2006, 06:12 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate val

Thanks Karl. I added a field to my table called "Index" and made it the
primary key, but the Combo box works the same. It appears to identify the
Adjustment column as the index column. Yes, I am attempting to enter two
separate values in one selection. The Adjustment value is entered correctly
in the prescribed text box; however, the Output Type simply defaults to the
label in the first row that corresponds to the Adjustment value. I may need
to break the two entries up, but was hoping to combine the two.

"KARL DEWEY" wrote:

I sounds like you are trying to select two types of criteria from the same
ComboBox. You can do that if you use a third field so the combination of the
two criteria use a unique number/character set in the third field.

You should use a separate ComboBox for each selection criteria.

"walkbyfaith7" wrote:

My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks

  #5  
Old April 18th, 2006, 06:17 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate val

Thanks Al. I added a third field called "Index" and made it an Autonumber,
but the Combo box still returns the first label that corresponds to the
Adjustment value, as if it is recognizing the Adjustment field as the primary
key. I would like for the combo box to return the label from the Output Type
field and then automatically enter the value in the Adjustment field in a
separate text box. Is this possible?

"Al Camp" wrote:

walkbyfaith7,
You'll need to add a key field to the underlying table upon which your combo is based.
AdjustmentType is not discreet or unique enough to define which OutputType you are
selecting.
Each record should have it's own unique identifier value, and the combo should select
by that value, not by the dupe fields.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"walkbyfaith7" wrote in message
...
My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks




  #6  
Old April 18th, 2006, 09:48 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate val

** Do not call your autonumber field "Index". That's a reserved word in Access. Call it
something like AdjustmentID.

Set up your combo... (ex name cboAdjustmentID)
FirstCol = Index, Second = Adjustment, Third = OutputValue
Set the combo properties...
ControlSource = AdjustmentID
ColumnCount = 3
ColumnWidths = 0"; 1"; 1" (fisrt value must be 0")
ListWidth = 2"

This setup allows you to "hide" the AdjustmentID, allow you to select by Adjustment
value, displays that Adjustment value, but really stores the AdjustmentID in the combo
"bound" field. OK, that takes care of storing the AdjustmentID, and "displaying" the
Adjustment value.
Now add an unbound field on your form named OutputValue. Give it a ControlSource of...
= cboAdjustmentID.Column(2)

This field will always display the correct OutputValue according to the AdjustmentID
stored in the cboAdjustmentID combo. Ther's no need to "save' the value, since you
captured the AdjustmentID... Adjustment and OutputValue can be derived from that on this
form, or any subsequent form, query, or report.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"walkbyfaith7" wrote in message
...
Thanks Al. I added a third field called "Index" and made it an Autonumber,
but the Combo box still returns the first label that corresponds to the
Adjustment value, as if it is recognizing the Adjustment field as the primary
key. I would like for the combo box to return the label from the Output Type
field and then automatically enter the value in the Adjustment field in a
separate text box. Is this possible?

"Al Camp" wrote:

walkbyfaith7,
You'll need to add a key field to the underlying table upon which your combo is
based.
AdjustmentType is not discreet or unique enough to define which OutputType you are
selecting.
Each record should have it's own unique identifier value, and the combo should
select
by that value, not by the dupe fields.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"walkbyfaith7" wrote in message
...
My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks






  #7  
Old April 20th, 2006, 02:48 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default how can I populate a field with a combo box with duplicate val

AL, THANK YOU SOOO MUCH! IT WORKS LIKE A CHARM.
BLESSINGS ABUNDANT TO YOU!!!!!

"Al Camp" wrote:

** Do not call your autonumber field "Index". That's a reserved word in Access. Call it
something like AdjustmentID.

Set up your combo... (ex name cboAdjustmentID)
FirstCol = Index, Second = Adjustment, Third = OutputValue
Set the combo properties...
ControlSource = AdjustmentID
ColumnCount = 3
ColumnWidths = 0"; 1"; 1" (fisrt value must be 0")
ListWidth = 2"

This setup allows you to "hide" the AdjustmentID, allow you to select by Adjustment
value, displays that Adjustment value, but really stores the AdjustmentID in the combo
"bound" field. OK, that takes care of storing the AdjustmentID, and "displaying" the
Adjustment value.
Now add an unbound field on your form named OutputValue. Give it a ControlSource of...
= cboAdjustmentID.Column(2)

This field will always display the correct OutputValue according to the AdjustmentID
stored in the cboAdjustmentID combo. Ther's no need to "save' the value, since you
captured the AdjustmentID... Adjustment and OutputValue can be derived from that on this
form, or any subsequent form, query, or report.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"walkbyfaith7" wrote in message
...
Thanks Al. I added a third field called "Index" and made it an Autonumber,
but the Combo box still returns the first label that corresponds to the
Adjustment value, as if it is recognizing the Adjustment field as the primary
key. I would like for the combo box to return the label from the Output Type
field and then automatically enter the value in the Adjustment field in a
separate text box. Is this possible?

"Al Camp" wrote:

walkbyfaith7,
You'll need to add a key field to the underlying table upon which your combo is
based.
AdjustmentType is not discreet or unique enough to define which OutputType you are
selecting.
Each record should have it's own unique identifier value, and the combo should
select
by that value, not by the dupe fields.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"walkbyfaith7" wrote in message
...
My combo box looks up a row from a table. The fields are "Output Type" and
"Adjustment". The problem is the adjustment values are the same for more
than one output type so that if the output type I am trying to select
contains a value that occurs earlier in the list, it returns that row's
output type, but the correct value is entered in the adjustment field. I
have been working on this for 3 days. Please help, anyone!

Thanks






 




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
enable a field if a given field is checked off- otherwise- don't w babs Using Forms 9 April 18th, 2006 03:36 PM
Update combo box in subform (After Update event) Karl Using Forms 10 April 4th, 2006 07:45 PM
Newbie: Need my combo box to populate another field based on selection Beeman General Discussion 4 June 17th, 2005 07:17 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
New Record Update Michelle Using Forms 5 October 28th, 2004 07:59 AM


All times are GMT +1. The time now is 06:09 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.