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  

Changing the combo box based on the entries in previous records



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2008, 06:31 AM posted to microsoft.public.access.forms
magicdds-[_2_]
external usenet poster
 
Posts: 38
Default Changing the combo box based on the entries in previous records

I have a form with a subform. The subform has a combo box that lists people
that might share in paying for a product (The list of people is in a table).

The user, when in record #1 of the subform, selects a payer from the combo
box and in the next field, types in how much that payer will pay towards the
product (In the main form). Then the user goes to record #2 and clicks a
payer in the combo box. The problem is the payer from record #1 is still
listed in the combo box, but that payer should not have 2 records created for
the same product.

Is there a way to have the combo box list only those payers that have not
already had a record created for this product, so multiple records cannot be
created for the same payer, for a given product?

Thanks
Mark

  #2  
Old April 16th, 2008, 09:21 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Changing the combo box based on the entries in previous records

Mark,

The problem is that on a continuous Form or subform, there is really only
*one* combo box - displayed many times. If you change its properties (its
RowSource in this case), all rows reflect that change.

One somewhat snarky but effective work around is to put a Textbox onto the
form, carefully superimposed over the text area of the combo box (don't
cover the dropdown tool though). Set its Control Source to either a DLookUp
expression looking up the current record's value from the lookup table, or
(if practical) base the Form on a query joined to the lookup table and
simply make it a bound textbox.

Set the textbox's Enabled = No, Locked = Yes, Tab Stop = No so the user
can't do anything with it; it's for display only. You may need to move it in
front of the combo box (with Move To Front on the Format menu).

When the user selects the dropdown, the combo box data will come in front
and allow (filtered) selection; when it's not selected, the user will see
the textbox.


Jeanette Cunningham


"magicdds-" wrote in message
...
I have a form with a subform. The subform has a combo box that lists people
that might share in paying for a product (The list of people is in a
table).

The user, when in record #1 of the subform, selects a payer from the combo
box and in the next field, types in how much that payer will pay towards
the
product (In the main form). Then the user goes to record #2 and clicks a
payer in the combo box. The problem is the payer from record #1 is still
listed in the combo box, but that payer should not have 2 records created
for
the same product.

Is there a way to have the combo box list only those payers that have not
already had a record created for this product, so multiple records cannot
be
created for the same payer, for a given product?

Thanks
Mark



 




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


All times are GMT +1. The time now is 07:20 PM.


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