Multiple Combo box in a form

i'm have a form. i want to do three combo box. one is customer, one is partID 
and one is process. this three combo box are from three different table. 
there are customer table, part master table and process table. i want to do 
like this. if i choose one of the customer from the combo box, then when i go 
to the partID combo box, then i want it just show out whatever the part which 
belong to that customer only. others customer's part wont be in the list. 
then when i click on the process combo box, then i just want the combo box 
show out the process which is belong to that partID which i choose only. 
example: i have 10 customer, when i choose A from the combo box, then it just 
show out the partID which are belong to A, then the process combo box just 
show the process for the partID. can anybody help me?

thanks!
0
Utf
10/25/2007 7:31:01 AM
access 16762 articles. 3 followers. Follow

4 Replies
676 Views

Similar Articles

[PageSpeed] 24

On Oct 25, 1:31 am, Irene <Ir...@discussions.microsoft.com> wrote:
> i'm have a form. i want to do three combo box. one is customer, one is partID
> and one is process. this three combo box are from three different table.
> there are customer table, part master table and process table. i want to do
> like this. if i choose one of the customer from the combo box, then when i go
> to the partID combo box, then i want it just show out whatever the part which
> belong to that customer only. others customer's part wont be in the list.
> then when i click on the process combo box, then i just want the combo box
> show out the process which is belong to that partID which i choose only.
> example: i have 10 customer, when i choose A from the combo box, then it just
> show out the partID which are belong to A, then the process combo box just
> show the process for the partID. can anybody help me?
>
> thanks!

do a search on 'Cascading combo boxes"

Here is one result I got for just such a search:

==================================
You need to put criteria in the SQL for the Row Source of each combo
box
that refers to the selection in each of the other two combo boxes. In
the
AfterUpdate event of each combo box, you need to issue a Requery to
each of
the other two combo boxes. The criteria should accept the fact that
either
or both of the other two combo boxes may be Null, in which case it
should
not filter the entries for that field.

Example criteria:


=Forms!frmMyForm!cboCombo2 Or IsNull(Forms!frmMyForm!cboCombo2)


The reason this works is because if you make a selection, the right
side of
the Or will be False, but the left side will then limit the results by
what
was entered in Combo2 (only one side of an Or statement needs to
return True
for the statement to be True). The left side of the statement will be
True
for all results that match the selection. If Combo2 is Null, then the
right
side of the Or is True and will always be True, regardless of the
value in
the field, so all values are returned.


--
Wayne Morgan
MS Access MVP


=====================================

0
Ron2006
10/25/2007 10:23:00 AM
Hello Irene.

"Irene" wrote:
> i'm have a form. i want to do three combo box. one is customer,
> one is partID and one is process. this three combo box are from
> three different table. there are customer table, part master table
> and process table. i want to do like this. if i choose one of the
> customer from the combo box, then when i go to the partID
> combo box, then i want it just show out whatever the part which
> belong to that customer only. others customer's part wont be in
> the list. then when i click on the process combo box, then i just
> want the combo box show out the process which is belong to that
> partID which i choose only. example: i have 10 customer, when i
> choose A from the combo box, then it just show out the partID
> which are belong to A, then the process combo box just show the
> process for the partID. can anybody help me?

You can configure the rowsource properties of the comboboxes as
follows (you must adjust the names appripriately):

CustomerComboBox:
Select CustomerID, CustomerName From Customer Order By CustomerName

PartComboBox:
Select PartID, PartName From Part Where CustomerID =
 [Forms]![TheForm]![CustomerComboBox]

ProcessComboBox:
Select ProcessID, ProcessName From Process Where PartID =
 [Forms]![TheForm]![PartComboBox]

Then you should ensure that after a costomer is selected, (in the
AfterUpdate event of the CustomerComboBox), that the other two
comboboxes are requeried and set to Null.
AfterUpdate for the PartComboBox, this has to be done only for the
ProcessComboBox.

Setting the ComboBoxes to Null has the following effect:
You choose an other customer, so the Part and Process boxes are set
to Null, no value is selected in those boxes.
The list os the pasrts displays the parts assiciated with the selected
customer and the list of processes is empty, since you did not yet
select a part. After also selecting a part, the list of processes
displays all processes that are associated with the selected part.

-- 
Regards,
Wolfgang





0
Wolfgang
10/25/2007 12:00:50 PM
hi Wolfgang Kais,

thanks for helping me. but i still have some question. i have try to use the 
way which you teach me. you say that in the AfterUpdate event of the 
CustomerComboBox, that the other two comboboxes are requeried and set to 
Null. how to do? can you show me? 

thanks!


"Wolfgang Kais" wrote:

> Hello Irene.
> 
> "Irene" wrote:
> > i'm have a form. i want to do three combo box. one is customer,
> > one is partID and one is process. this three combo box are from
> > three different table. there are customer table, part master table
> > and process table. i want to do like this. if i choose one of the
> > customer from the combo box, then when i go to the partID
> > combo box, then i want it just show out whatever the part which
> > belong to that customer only. others customer's part wont be in
> > the list. then when i click on the process combo box, then i just
> > want the combo box show out the process which is belong to that
> > partID which i choose only. example: i have 10 customer, when i
> > choose A from the combo box, then it just show out the partID
> > which are belong to A, then the process combo box just show the
> > process for the partID. can anybody help me?
> 
> You can configure the rowsource properties of the comboboxes as
> follows (you must adjust the names appripriately):
> 
> CustomerComboBox:
> Select CustomerID, CustomerName From Customer Order By CustomerName
> 
> PartComboBox:
> Select PartID, PartName From Part Where CustomerID =
>  [Forms]![TheForm]![CustomerComboBox]
> 
> ProcessComboBox:
> Select ProcessID, ProcessName From Process Where PartID =
>  [Forms]![TheForm]![PartComboBox]
> 
> Then you should ensure that after a costomer is selected, (in the
> AfterUpdate event of the CustomerComboBox), that the other two
> comboboxes are requeried and set to Null.
> AfterUpdate for the PartComboBox, this has to be done only for the
> ProcessComboBox.
> 
> Setting the ComboBoxes to Null has the following effect:
> You choose an other customer, so the Part and Process boxes are set
> to Null, no value is selected in those boxes.
> The list os the pasrts displays the parts assiciated with the selected
> customer and the list of processes is empty, since you did not yet
> select a part. After also selecting a part, the list of processes
> displays all processes that are associated with the selected part.
> 
> -- 
> Regards,
> Wolfgang
> 
> 
> 
> 
> 
> 
0
Utf
10/26/2007 12:41:01 AM
Hello Irene.

"Irene" wrote:
>>> i'm have a form. i want to do three combo box. one is customer,
>>> one is partID and one is process. this three combo box are from
>>> three different table. there are customer table, part master table
>>> and process table. i want to do like this. if i choose one of the
>>> customer from the combo box, then when i go to the partID
>>> combo box, then i want it just show out whatever the part which
>>> belong to that customer only. others customer's part wont be in
>>> the list. then when i click on the process combo box, then i just
>>> want the combo box show out the process which is belong to that
>>> partID which i choose only. example: i have 10 customer, when i
>>> choose A from the combo box, then it just show out the partID
>>> which are belong to A, then the process combo box just show the
>>> process for the partID. can anybody help me?

>> You can configure the rowsource properties of the comboboxes as
>> follows (you must adjust the names appripriately):
>>
>> CustomerComboBox:
>> Select CustomerID, CustomerName From Customer Order By CustomerName
>>
>> PartComboBox:
>> Select PartID, PartName From Part Where CustomerID =
>>  [Forms]![TheForm]![CustomerComboBox]
>>
>> ProcessComboBox:
>> Select ProcessID, ProcessName From Process Where PartID =
>>  [Forms]![TheForm]![PartComboBox]
>>
>> Then you should ensure that after a costomer is selected, (in the
>> AfterUpdate event of the CustomerComboBox), that the other two
>> comboboxes are requeried and set to Null.
>> AfterUpdate for the PartComboBox, this has to be done only for the
>> ProcessComboBox.
>>
>> Setting the ComboBoxes to Null has the following effect:
>> You choose an other customer, so the Part and Process boxes are set
>> to Null, no value is selected in those boxes.
>> The list os the pasrts displays the parts assiciated with the
>> selected customer and the list of processes is empty, since you did
>> not yet select a part. After also selecting a part, the list of
>> processes displays all processes that are associated with the
>> selected part.

> thanks for helping me. but i still have some question. i have try
> to use the way which you teach me. you say that in the AfterUpdate
> event of the CustomerComboBox, that the other two comboboxes are
> requeried and set to Null. how to do? can you show me?

Of course.
In form design view, select the PartComboBox, open the properties
window (if not already visible), click the event tab, clic in the
After Update property, select [event procedure], click "...".
This will open a code window than contains the following:

Private Sub PartComboBox_AferUpdate()

End Sub

This has to be modified such that it reads like this:

Private Sub PartComboBox_AferUpdate()
    ProcessComboBox.Requery
    ProcessComboBox = Null
End Sub

For the CustomerComboBox, do the same steps and modify the sub
procedure such that it reads like this:

Private Sub CustomerComboBox_AferUpdate()
    PartComboBox.Requery
    PartComboBox = Null
    Call PartComboBox_AferUpdate
End Sub

That's it.

-- 
Regards,
Wolfgang


0
Wolfgang
10/26/2007 6:35:43 PM
Reply:

Similar Artilces:

Making a form Maximize when opened?
How do I do this? "m galvin" <mgalvin@discussions.microsoft.com> wrote in message news:7BE1B7CF-E57A-42D5-B103-8A48E657C0E5@microsoft.com... > How do I do this? In the form's Open event, execute the statement: DoCmd.Maximize Note that maximizing a form also maximizes any other (non-popup) forms and reports, so you may want to restore things when the form closes. In that case, you could use the form's Close event to execute the statement DoCmd.Restore You can also do the same thing using the corresponding macro actions, Maximize an...

How do I get a dialog box asking if I want to open a downloaded do
When I download a document, I would like a pop-up box to ask if I want to open the document. On Wed, 24 Feb 2010 18:02:01 -0800, Ron <Ron@discussions.microsoft.com> wrote: >When I download a document, I would like a pop-up box to ask if I want to >open the document. It seems to me that would be a function of whatever program you're using to do the downloading. Is that Word? -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. ...

Making the custom form available
Hello: I have an exisiting contacts in the contacts folder. I redesigned the contact form and published it and now have all my new conacts using the new form. However how do I get the older pre exisitng contact items to update to the new form. Thanks Brian You would need to update the message class. See the link below for more info. http://support.microsoft.com/default.aspx?scid=kb;en-us;201087&sd=RMVP "Brian" <waly2990@optonline.net> wrote in message news:OkFVg.204$Jl6.125@newsfe08.lga... > Hello: > I have an exisiting contacts in the contacts folder. I...

Javascript alerr in crm forms
If you open a crm form for an account/contact or any other entity, make some changes and try to close the window without saving information, you see this javascript pop up which warns you of the unsaved information. In our deployment, we see this window even if we do not change anything!! Any idea how to take care of this issue? Thanks Typically this is caused when records were saved without some "default" information that the forms wants in there. This could have been from integration or data saved prior to the form being updated. Matt Parks MVP - Microsoft CRM ------------...

CenterWindow and Multiple Monitors
I have a SDI application. When dialog boxes are displayed on a system with one monitor, the dialog is centered in the Main Frame (this is fine). But when run on a system with multiple monitors and the Main Frame is not in the Primary Monitor, the dialogs are centered in the Primary Monitor (not the SDI App Main Frame). How do I center the dialogs in the SDI Main Frame when using Multiple Monitors. -- Hank Williams Quantum Technologies, Inc. HaWilliams(at)spamcop.net > How do I center the dialogs in the SDI Main Frame when using Multiple > Monitors. I'm sure there are op...

How do you create a list with name address phone in a column form.
I have an excel file with last name, first address city state in each column. I want to prepare a two column report with each persons name first then address then phone. Can't remember how to print out a different view of excel. Making it look more like a two column word document. Maybe you can use MSWord's MailMerge. http://www.mvps.org/dmcritchie/excel/mailmerg.htm http://www.mvps.org/word/FAQs/MailMerge The first is from David McRitchie and the second is by Beth Melton and Dave Rado. denise108 wrote: > > I have an excel file with last name, first address city state ...

Text box disappears on chart
I added a text box to a chart and when I click off of it, the text box disappears (goes behind the chart). I have tried Bring to Front and Bring Forward, and it may or may not stay visible and print. I have clicked on the frame of the text box (it changes pattern) and tried Bring to Front - same problem. Any ideas? Carole O The text box is on the worksheet, not the chart. To fix the problem, Select the text box, and choose Edit>Cut Select the chart (you'll see handles on its corners and sides) Choose Edit>Paste, to paste the text box onto the chart. Click away from the char...

How can I get the selected item number from a combo box?
How can I get the selected item number from a combo box. Say that combo has only two items: (Madam;Mister). If "Madam" is selected, I would like to get item number of Madam < it is zero in this example. Thank you You refer to the value via the name of the control. If it is multi-column, you append .column(number) to the name where number is 0 for the first column. -Dorian "mezzanine1974" wrote: > How can I get the selected item number from a combo box. Say that > combo has only two items: (Madam;Mister). > If "Madam" is selected, I would like to g...

Show Names drop down box not working
I recently graduated to Office 2003 and I'm having a problem I don't know how to get around. I want to send this email to a large number of people, so I want to select several names from one of my contacts folders. But it won't let me. Here are the steps I'm going through: From the Mail Screen, New, To, then I want to click on the "Show Names from the" drop down box, but it won't let me. When I click on the drop down arrow, nothing happens. I have used Outlook in its various versions for years and have always used this feature. These files were imported fr...

Sending to multiple addresses
How do I send an email to multiple addresses having only the recipient see their own email address? Michelle wrote: > How do I send an email to multiple addresses having only > the recipient see their own email address? Put the addresses into the BCC: field. Note that many e-mail programs will decide such mails are spam though. >-----Original Message----- >How do I send an email to multiple addresses having only >the recipient see their own email address? >. Open your new email and go to tools, select recipient, when your address book opens select (highlight) the a...

Storing Multiple Selections
I coordinate volunteers and need to store the days and times when they're available on a custom form. Anyone have a good suggestion as to how to go about this? Why not just use a calendar for that purpose? No form needed. Name as subject, and plug in the time range. OutdoorRuss wrote: > I coordinate volunteers and need to store the days and times when > they're available on a custom form. Anyone have a good suggestion as > to how to go about this? ...

Deleting Multiple PST Files
I now have 3 sets of personal folders in Outlook 2002. I need to delete 2 of them so I can eliminate the confusion when saving files. How can I delete the additional personal files. I tried deleting Outlook and reinstalling but it automatically kept everything. Dear Brian, have a look on this site: http://office.microsoft.com/en-us/assistance/HA011170471033.aspx may it helps. -- Oliver Vukovics Public OutLook: Share Outlook without Exchange Public SyncTool: Outlook PST Synchronization www.outlookstore.com Brian wrote: > I now have 3 sets of personal folders in Outlook 2002. I ...

hosting multiple domains #2
Hi Im running exchange 2003 on a windows 2003 AD domain. I am trying to host a second domain on my server. I have created a group in ADUC and populated this group with the users whom i want to recieve the 2nd domain email address. I setup my email address policy and i search for this group based on the groups distingushed name. The policy runs fine, but only the group i created gets the 2nd domains email address, none of the users i put in this group do. Do i have to create another recipient policy based on a user attribute? this would mean that i would have to create two recipient policies o...

Double click to open form and create new record
Hi team, Have scoured all of the posts and tried several different things for days but just can't seem to nut this one out. I have a form (FrmSeedBankStockAvailable) in datasheet view that lists seed lots by BatchID. I want to be able to double click on the record selector for a particular batch and have a form (DialogSeedBankWithdrawal) open so that I can make a new withdrawal entry, with the BatchID already entered from the selected record. I know that to do this I need to use the forms' DblClick property. I have been using the following code (and tried variations of from...

WORD FORMS
I need to change the colour of a CELL in a word form depending on the seletion of a Dropdown form called "Select Level" which provides 4 differing levels to choose from. Level 1 = Platinum Level 2 = Gold Level 3 = Silver Level 4 = Bronze And i Wish to change the colour of cells further down the form to those colours specified against each level. I believe that I may need touse a macro to do this, but have never actually used one before and do not even know how to start (Complete Novice in Macro) so would need instructions of how to input the macro if anyone is kind e...

send/receive dialogue box #2
I have ticked the box to remove details from my send/receive dialogu box. Cannot find how to get it back to show any errors etc. Thanks for any help Philk:confused ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com ...

Chart numbers from multiple sheets
Is Excel 2002 capable of creating a chart based on numbers from multiple sheets in a workbook? Addressed in your other thread. Regards, Leni -- LeninVM ----------------------------------------------------------------------- LeninVMS's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=668 View this thread: http://www.excelforum.com/showthread.php?threadid=31954 ...

multiple email addresses for contact
Is there any way to modify the email address field to allow multiple email addresses for one contact? Thanks hello, you can add custom attributes to the entity contact, so you can, for example, create fields like "new_email2", "new_email3" and show them on the contact form. "lynn" wrote: > Is there any way to modify the email address field to allow multiple email > addresses for one contact? > > Thanks But can you then select that email address for "To"? This seems also to be an issue with Spouse Email and Personal Email, built in...

Multiple Account Lookup fields
Hi all, These newsgroups have been an immense wealth of knowledge, thank you to all who contribute! I have one item that I'm struggling with. I have added a custom entity and added two N:1 relationships back to the accounts. This is giving me two lookup fields on the form for the custom entity which is what I wanted. However, what I didn't realised is I now show the custom entity twice on the Account form. I'll give an example of what I'm looking for, let's say I have a custom entity for a Building. What I want is to have a lookup field linked to an Account fo...

Using check boxes to limit a report.
I have a table which lists all possible items for a vendor. I want to create a form that shows all of the items. I want the user to be able to place check marks next to the items they want. I then want to run a report which shows all of the information about the items, but only for the items that had been checked. What is a good way to approach this? I can't seem to find a way to link the check boxes to the item table and don't know how to create a report once they are linked. Can someone please direct me on how to do this? Or at least to somewhere that I can find out how to do ...

Drop Down boxes #8
I want to create a drop down box where if no options are used within the drop down, then you are able to type your own answer You can enter any item in a cell with a data validation list, if you remove the check mark from 'Show error alert after invalid data is entered', on the Error Alert tab in the Data Validation dialog box. The box is shown here: http://www.contextures.com/xlDataVal04.html#Error Brian wrote: > I want to create a drop down box where if no options are used within the drop down, then you are able to type your own answer -- Debra Dalgleish Excel FAQ...

setup a text box as a lined page
I'd like to simulate text on lined paper. Is it possible in Word or Publisher? Thanks Find a lined paper background or graphic, put it on the Master page. On the the publication page create a text box. View, turn on baseline guides. Go to Arrange, Layout guides, baseline tab, adjust it to match your lined graphic. Select the text box, Format, paragraph, check align text to baseline guides. http://images.google.com/images?hl=en&q=lined+paper&gbv=2 -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "tridev" <tr...

Pop up Form to set parameter of query to generate a report
I have a pop up form that opens when I run a report via a macro. The query searchs for an item (drug) that has 2 different mnemonics. (fields are mnemonic2 and mnemonic3 from table PDM) I cannot append the table fields into a new column because the table is on a server that does not allow changes. The problem is that I cannot figure out a way to attach [Forms]![frm_mnemonic]![lstbox] ---the combobox I am using on the form ----to mnemonic2 and mnemonic3 so it it will search both since they are both text values. I can attach it to one or the other field and it works fine, but when I attach it ...

Changing Names of Multiple Cell Link Ranges
I have a series of drop down boxes created with the Forms menu. The cell link range for each dropdown is different, as follows: Cell Link Box1 = DemandBase_A_UndistExp1 Cell Link Box2 = DemandBase_A_UndistExp2 Cell Link Box3 = DemandBase_A_UndistExp3 Cell Link Box...n = DemandBase_A_UndistExp...n I want to change them all at once to: DemandBase_A_OtherCost1 DemandBase_A_OtherCost2 DemandBase_A_OtherCost... I know I can change the entire name using the following code: Sub Change_Drop_Link() For Each bx In ActiveSheet.DropDowns If bx.LinkedCell = "DemandBase_A_UndistExp1" Then ...

Combo box for related records AND non-related records
Hello, Sorry if this question has been answered, but my searches have not yielded the posts. Here is what I want to do: I have a form with a combo box for City and one for State. I have two lookup tables: lkpCity cityID, City, stateID lkpState stateID, State I have the combo box for City set up, and the one for State to depend on the control for City. These are necessary because we've got a lot of spelling errors. Very often, however, the respondents whose data we are entering fail to provide a city, but list their state. If this happens, I can't get a l...