Filter Combo Box Options based on other Combo Box Selection

Good morning,

I really hope someone can help me with this, I am very new to Access

I have a form a "Trade" form where the user using the database selects a 
client using a combo box (cboClient) [the available clients are populated in 
a table called tbl_Client],

The next thing the user needs to is select a product using a combo box , 
however only certain products are available to certain clients (based on the 
table: tblCommission), therefore, I am trying to limit the visible options in 
the products combo box to just such products.

I know that I need to therefore use some code in the afterupdate event of 
the cboClient, but have so far been unable to find any method of doing so.

Please help, I would really be very grateful.

Further info that could be needed:
Client Field title: Client_Surname (is the primary key in tbl_Clients; is 
also of course in the tblCommission)
Product Field title:  Product_Code

Thank you in advance, if you need any further info from me in order to 
assist, please ask and I will reply ASAP
0
Utf
1/11/2010 12:56:01 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
878 Views

Similar Articles

[PageSpeed] 22

PVANS wrote:
>I have a form a "Trade" form where the user using the database selects a 
>client using a combo box (cboClient) [the available clients are populated in 
>a table called tbl_Client],
>
>The next thing the user needs to is select a product using a combo box , 
>however only certain products are available to certain clients (based on the 
>table: tblCommission), therefore, I am trying to limit the visible options in 
>the products combo box to just such products.
>
>I know that I need to therefore use some code in the afterupdate event of 
>the cboClient, but have so far been unable to find any method of doing so.
>
>Please help, I would really be very grateful.
>
>Further info that could be needed:
>Client Field title: Client_Surname (is the primary key in tbl_Clients; is 
>also of course in the tblCommission)
>Product Field title:  Product_Code
>

A common way to do that is to create a query with a criteria
on the products for that client.  Something like:

SELECT Product_Code, ProductName
FROM Products
WHERE Client_Surname = Forms!yourform.clientcombobox

Then set the products combo box's RowSource to the query.

With that in place, add some code to client combo box's
AfterUpdate event procedure:

If IsNull(Me.clientcombobox) Then
	Me.productcombobox = Null
Else
	Me.productcombobox.Requery
End If

You will probably want to add the same lines of code to the
form's Current event procedure.

-- 
Marsh
MVP [MS Access]
0
Marshall
1/11/2010 2:06:23 PM
Reply:

Similar Artilces:

upgrading the OS on Exch2003 box
I have successfully upgraded Exch2000 to 2003. The OS is still Windows 2000 Server. Now I'm ready to upgrade that box to Windows Server 2003. Is there anything special I should note before upgrading, or is there a specific document which addresses any known method or problems ? thanks chrism "chrism" <chris@no_spam> wrote: >I have successfully upgraded Exch2000 to 2003. >The OS is still Windows 2000 Server. > >Now I'm ready to upgrade that box to Windows Server 2003. > >Is there anything special I should note before upgrading, or is there >a...

Combo Chart
I would like to do a combo chart. Any ideas? TIA Lacreeda Lacreeda - Plot all the data in a chart using the chart type you want to use for most of the series. Select one series you want to change, choose Chart Type from the Chart menu, and pick the chart type you want for this series. Repeat for any other series you want to change. Excel offers some built in combo types, but it's easy to make your own, and you can be much more flexible this way. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Lacreeda wrote: > I wou...

How OMPM Scanner (offscan) Filter by Access/Modified Date ?
Hello, I have problem to inventory excel files on very big file server, but I believe there are so many documents we no longer need to maintain. I want to skip files if the access date or modified date longer than 6 month, but don't see the OMPM providing feature about it. I currently running OMPM since 2 weeks ago and running out of time for reporting to my manager. Please help me, this is my critical assignment. -- Eldi Munggaran ...

What is 'Align Text to Base Line Guide'?
Trying to make sure all lines have the same amount of space between them I selected paragraph from the format menu and under the line adjustments there is a box 'align text to base line guides' Ok I did that, now there are lines at the margines of my newsletter. What are these? Also selecting this pushed my text down from the top edge of the text box. What is this? The baseline guide measurements are in the Arrange, Layout Guides, Baseline tab. There is help in the Help menu. -- Mary Sauer http://msauer.mvps.org/ "Go_Girl3647" <GoGirl3647@discussions.microsoft.com...

How to create an "and" rule in Query Based Distribution Groups
Hi, With Exchange 2003 Query Based Distribution groups, is it possible to create an "and" rule? ie, all users who are based in "London" "and" have the first name "John"? Thanks, Curtis. -- Please reply to news group only. Thank you. Sure. (&(attribute1=blah)(attribute2=blah)) http://msdn.microsoft.com/library/en-us/adsi/adsi/search_filter_syntax.asp?frame=true -- Bharat Suneja MCSE, MCT www.zenprise.com blog: www.suneja.com/blog ----------------------------------- "Curtis Fray" <xxx@xxx.com> wrote in message news:OjVc...

outlook 2003sp3: applying the inbuilt junkmail filter on existing messages?
hi all, would like to apply the outlook junk mail filter, with settings set to 'high', on emails already in my inbox. is there any way of doing this? apologies if this has been posted before, I've made a couple of searches but can't find anything... many thanks! No, there's no way to apply the spam filter to already downloaded items. <spam@redo.net> wrote in message news:1137601837.257355.134230@g43g2000cwa.googlegroups.com... > hi all, > > would like to apply the outlook junk mail filter, with settings set to > 'high', on emails already in my...

Delivery Options Does Not Show Up.
I need to setup an alternative recipient to one of my mailboxes but I can't seem to find the Delivery Options Button under "Exchange Advanced" tab of ADU&C. I can only see three options: Custom Attributes ILS Settings Mailbox Rights What am I missing. It should be there. Thanks for your time Percy it's on the Exchange General tab... -- Susan Conkey [MVP] "Percy" <Percy@discussions.microsoft.com> wrote in message news:845C7BCF-BB5B-4E56-9CB6-5C05F32F3A9E@microsoft.com... >I need to setup an alternative recipient to one of my mailboxes but ...

get rid of macro option at startup
I created and then deleted a macro in an Excel file. Why do I still get the warning box (i.e. the one asking if I want to enable or disable macros) when I open the file? Is there a way to get rid of this since I no longer have macros in this file? Thanks. Brad You need to delete the empty module.! Bill K "Brad Rench" <brench@comcast.net> wrote in message news:kSOdnb0Jjst9afaiXTWJkg@comcast.com... > I created and then deleted a macro in an Excel file. > > Why do I still get the warning box (i.e. the one asking if I want to enable > or disable macros) when I o...

How to write a new entry in a combo box to its underlying table
Dear Access 2007 VBA Gurus, I have a assets database (rather uncreatively named "Assets"). I use a form (named "Asset Acquisition Input Form New") to enter new assets. The "Manufacturer" field (combo box name "Manufacturers_ID) on this form is a lookup to a Manufacturers table. What I want to happen is when I enter an item that is not in the lookup list, I want a message box to prompt me to add the new entry to the underlying table, or to cancel and select an item from the list. I have no trouble with the MsgBox command itself. What I don&...

Intelligent Message Filter Installation Failure
I've tried installing the Intelligent Message Filter on a Windows 2000 SP4 Exchange 2003 SP1 server. The installation fails at around 98% with the following error: There is a problem with this Windows Installer package. a program run as part of the setup did not finish as expected. contact your support personnel or package vendor. I tried downloading it again, and had the same results. Any ideas? Thanks ...

Excel 2003 Copy/Paste filtered column
I have a filtered column on my spreadsheet. I have copied the column, changed the figures and then tried to paste it back on to the filtered column. It is not copying over the original filtered column but rather over cells that have been filtered out. The worksheet/cells are not protected. What could the problem be? Kind Regards Heather That's the way pasting works. It'll hit the visible and hidden cells. Heather wrote: > > I have a filtered column on my spreadsheet. I have copied the column, > changed the figures and then tried to paste it back on to the filter...

Intelligent Message Filter (IMF) SCL for Junk E-mail being ignored
I have Exchange Server 2003 Enterprise SP1, and I recently downloaded and installed Intelligent Message Filter. In Message Delivery Properties -> Intelligent Message Filtering, I have - Gateway Blocking Configuration SCL 8 - Store Junk E-mail Configuration SCL 8 All users have Outlook 2003 Professional installed. Although I have SCL set to 8 for "Store Junk E-mail Configuration", Messages with SCL 6 and others with SCL as low as 3 are being sent to the Junk E-Mail folder. I am able to see the SCL of the emails because I installed an SCL Column via Forms using th...

tbBox options
In the XML files, for the <BORDER> tags, tbBoxColumns forms a border on either side of a cell, tbBoxRows forms a border above and below a cell. What option forms a border on all 4 sides of the cell? Thanks, Rance hi you can use <BORDER> tbAll </BORDER> "Rance" wrote: > In the XML files, for the <BORDER> tags, tbBoxColumns forms a border on > either side of a cell, tbBoxRows forms a border above and below a cell. What > option forms a border on all 4 sides of the cell? > > Thanks, > Rance ...

Payables Trial Balance Report with Options
I am trying to run an A/P Trial Balance Report today that will give me the A/P balance at January 31, 2007. I keep getting the balance as as February 28, 2007. I've run the same report for A/R and am able to get the balance as at January 31, 2007. Currently using GP 9.0. With my previous employer who was also using GP 9.0, I sure that we were able to run an A/P Trial Balance report for a previous period. Does anyone have any suggestions as to what I my be missing or what may be set up incorrectly? -- JR JR, The only date that you can spcify on the Aged Trial Balance With Options, ...

selecting a cell
I seem unable to select a single cell, or a single row--click on one in the normal manner, and the two below also highlight, then delete or whatever command is given. If I input a number/text, that just goes into the one cell. tapping F8 increases this to two wide and three high automatically selected. Also, very slow to do almost anything. Thanks Pat, Are you by any chance using Excel 2007? If so there is a known bug that causes multiple cell selection and I understand this has been reported to Microsoft. If you take the zoom level up and down this is reported to cl...

E-mail box sizes. Echange System Manger.
Hi. Now and then I need to find out the size of the various e-mail boxes in Exchange2000. The problem is that the size indicated in the Exchange System Manager do not reflect the same size when you look into Outlook. Is the a way to figure out the correct e-mail size? If not. Is this better in Exchange2003? Thank you in advance. DagN I'd consider the Exchange value to be the most important given this is what will be used for mailbox quotas, etc. Nue "Dag N" <skier@start.no> wrote in message news:OjCaWfjLGHA.2320@TK2MSFTNGP11.phx.gbl... > Hi. > Now and then ...

Junk E-Mail filter unavailable in online mode
We had Outlook 2003 clients on an Exch 2000 server, and, as expected, the Junk E-Mail filter was not available when working in online mode. In cached mode it was working fine. Now, after upgrading the organization and server to Exch 2003, the Junk E-Mail filter is still not available in online mode. According to all the MS documentation this should be working. Any ideas? Thanks kindly, FV All of the documentation that I have know of says that it works on in Cache Mode. Can you give us a link to the documentation that you saw that shows it will work with online profiles? Thanks, -- Matth...

Selecting cell value for a sum, based on a condition
Trying to come up with a formula or method that will enable me to sum values based on a condition. For example, I have three columns which contain a condition and two amounts. If the condition is of the 'each' variety, one value will be used in the sum. If the condition is of the "square foot" variety, another value will be used. Here is a small diagram that may help visualize this: A B C D 1 Measure Unit Cost S.F. Cost Summed Total 2 Each 3.00 .30 3 S.F....

Routing Restrictions button unavailable (gray) no matter what options selected in IMS-->Routing tab
I am running Exchange 5.5 SP4. In Connections-->IMS-->Routing Tab, my "Routing Restrictions" button is unavailable (greyed-out) no matter what options I select. Any suggestions? Thank you. Try installing Exch Admin prog on other machine, apply SP4 and see if you can change it from there. Post back with details. ryanadmin wrote: > I am running Exchange 5.5 SP4. In Connections-->IMS-->Routing Tab, my > "Routing Restrictions" button is unavailable (greyed-out) no matter > what options I select. Any suggestions? Thank you. ...

Highlight color for selected items
How can I find out what color is used for highlighting selected items (for example in Windows Explorer)on a users computer? Normally it is a blue color, but a user can change that. "Urban Olars" <anonymous@discussions.microsoft.com> wrote in message news:071c01c3c941$3db2c890$a401280a@phx.gbl... > How can I find out what color is used for highlighting > selected items (for example in Windows Explorer)on a users > computer? > Normally it is a blue color, but a user can change that. See if it's GetSysColor/COLOR_HIGHLIGHT. -- Jeff Partch [VC++ MVP] Take a ...

Enable/Disable a Form Control Based on Security Group Permissions
How do I enable or disable a control in a form based on a user’s security group membership? For example: If I have a checkbox on a form (call it box1), I want box1 to be enabled if the user who opened Access is a member of a security group called “Breaker Test Admin.” For members of any other group (except of course “Admins”), box1 should be disabled. Thank you, for your help! On Mon, 02 Jul 2007 18:57:13 GMT, "BenS" <u35527@uwe> wrote: >How do I enable or disable a control in a form based on a user�s security >group membership? For example: If I have a checkbox on a ...

How to return the primary key from a combo box
I have a table containing two columns Column 1: Primary key Column 2: Name. I want to create an unbound combo box that shows the name but returns the PK. I have these properties set: Control source: <is empty> Row source type: table/query Bound column: 1 Row source: <I have a select that returns the desired records> In cboClient_AfterUpdate() I look at debug.print cboClient.Value and I see the name. I need the PK so I can construct the query for the next combo box. How do I get the PK Thanks for the help -- Message posted via http://www.accessmons...

Simple Yes/No drop down box
Hi, I am looking to create a simple drop down box which has yes or no as the options. For the life of me i can't remember how to do it. Thanks Select the cell and then click on Data | Data Validation. In the dialogue box for Allow click on List, and then in Source you can type "Yes,No" (without the quotes) and ensure that In-cell drop-down is checked. Click OK and then you have it. Hope this helps. Pete On Apr 21, 9:41=A0am, Debi <D...@discussions.microsoft.com> wrote: > Hi, I am looking to create a simple drop down box which has yes or no as = the ...

EXTRACTING UNIQUE RECORD BASED ON CONDITION
This is a multi-part message in MIME format. ------=_NextPart_000_0012_01C781BF.08FB92F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello everyone! I would like to extract unique records based on a condition. For = example, how to extract unique record from column 'B' when column 'A' = has "AP" or any other desired condition. The data is as follows: A B =20 MI 70056542=20 MI 70056543=20 AP PATRICK CUDAHY INCORPORATED=20 AP PATRICK CUDAHY INCORPORATED=20 AP SUGAR CREEK ...

creating nested formulas from drop down box
Hi, I have cell A1 with a drop down box containing 26 available choices. B1 has the dollar amount matching to the choice in A1 using vlookup. E1 totals several cells including B1 together. I want F1 to look at A1 and either enter the number from E1 or NA. Here's billing example: A1=January , B1=$5 ,C1=$10, D1=$1, E1=$16 (total of b-d1) F1 is the column for January G1 is the column for February H1 is the column for March, etc If A1 = Jan, then F1 should be $16 If A1 = Feb, then F1 should be NA or $0 This is the formula that has been working so far: =IF((G2="...