How to Make Cascading Combo Boxes in MS Access

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2020
  • This week, we are cascading into action with cascading combo boxes in MS Access. Also known as drop-down lists, combo boxes can be made to cascade in many interesting ways. For example, you might choose a manufacturing assembly in one combo box and then have the next combo show only the parts for that assembly. In this video, we are going to demonstrate a combo box trio that will let you select country, then region of that country, then city from that region. Many thanks to viewer @pilotgarry for the request to make this video.
    Related Videos:
    How to Make a Search Form with Combo Boxes in MS Access
    • How to Make a Search F...
    How to Make Cascading Combo Boxes in MS Access
    You are watching this video now!
    Bound vs. Unbound Forms and Controls in Microsoft Access
    • Bound vs. Unbound Form...
    How to Make a Listbox in MS Access Part 2: Multi-select
    • How to Make a Listbox ...
    How to Create In and Out Listboxes in Microsoft Access
    • How to Create In and O...
    How to Make a Multi-Term Search Form and Report in MS Access
    • How to Make a Multi-Te...
    How to Use Timers to Run Actions or Code on an Interval in Microsoft Access
    • How to Use Timers to R...
    How to Use Before Update in Microsoft Access
    • How to Use Before Upda...
    How to Make Changes to Text in a Textbox in Microsoft Access Using SelStart and SelText
    • How to Make Changes to...
    How to Add Combo Box Rows On-The-Fly in MS Access
    • How to Add Combo Box R...
    How to Run Code as Your MS Access Form Opens - On Open, On Load, and On Current
    • How to Run Code as You...
    How to Use On Close and On Unload with Microsoft Access Forms
    • How to Use On Close an...
    You can find the data used in this example on this link:
    datahub.io/core/world-cities
    Credit for the dataset: geonames
    Special thanks: Lexman and the Open Knowledge Foundation
    Follow us on social media:
    / mackenziedataanalytics
    / seamacke
    / seamacke
    / seamacke
    / psmackenzie
    Get Microsoft Office including Access:
    click.linksynergy.com/fs-bin/...
    Got a TH-cam Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy.com/seanmackenz...
    For developers looking for a new role, check out:
    www.toptal.com/qKaO2b/worlds-...
    Needing to hire technical resources for your project? Get the best:
    www.toptal.com/qKaO2b/worlds-...
    How to Make Cascading Combo Boxes in MS Access
    ms access combo
    cascading combo boxes ms access
    cascading drop down lists ms access
    ms access filter combo box
    ms access after update event
    ms access update combo box
    ms access rowsource
    ms access row source
    ms access combo box row source
    country drop down list
    city drop down list
    ms access city combo box
    ms access country state city drop down list
    Sean macKenzie Data Analytics
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 185

  • @ProfGilRodrigues
    @ProfGilRodrigues 2 ปีที่แล้ว +5

    There are several ways to build a cascading combobox. This was the simplest and most straightforward I've ever seen here on TH-cam. Congratulations.

  • @ajn4753
    @ajn4753 3 ปีที่แล้ว +2

    I was about to lose my mind until I watched this video! THANKS!!!!!!!!!!!!!

  • @aryanrathod5311
    @aryanrathod5311 7 หลายเดือนก่อน +2

    Thank you very much for this simple method and it worked accurately in my project that I am working on for my internship

  • @ricardoglopes7687
    @ricardoglopes7687 ปีที่แล้ว +2

    Whenever we see a video that significantly increases our knowledge, our expectations also go high. So, here is the question. Can the user select only one segment, say Regions and the other ones would update accordingly? I realize the complexity as all drop-down boxes would start with a full house (poker analogy). 😀

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว +1

      Yes, you can do this as well. A user could select a Region and the country would update as well as the list of possible cities.

  • @mitchellfolbe8729
    @mitchellfolbe8729 ปีที่แล้ว +2

    It only took me about an hour and going through this 4 times to get it. I think I made about every mistake you could make before it worked. Thank you.

  • @ronthornton4421
    @ronthornton4421 4 หลายเดือนก่อน +1

    Thank you! This was easy to follow. Expanding the query column when referencing the cboCountry combo would have been good for me to see the entire criteria statement.

  • @franciscorossier5239
    @franciscorossier5239 3 ปีที่แล้ว +2

    Awesome. Saved me hours of trial an horror. Thanks Sean! Hugs from Chile (which quickly appear in the video in the country list XD )

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      I'm glad it worked for you! Chile is close to the top of the list :-D Good luck on your project!

  • @rrpprp
    @rrpprp 3 ปีที่แล้ว +2

    VERY helpful and beautifully explained, thanks a lot!!!

  • @pilotgarry
    @pilotgarry 4 ปีที่แล้ว +2

    Enjoyed this one especially how you get the combo boxes to update themselves

  • @hankcohen3419
    @hankcohen3419 3 ปีที่แล้ว +3

    Excellent! Exactly what I needed to know. I especially like the additional tips on how to clean up when things change.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Glad it was helpful!

    • @lion_0077
      @lion_0077 2 ปีที่แล้ว +1

      @@seanmackenziedataengineering one question, how to use cascading combobox in continuous forms????, because when I go to second records it's disturbing all other records

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      @@lion_0077 It does not work in continuous forms. Too bad! It would be neat. You can create a series of subforms to simulate continuous forms and then apply cascading combos, but that is a lot of work!

    • @puneboy123
      @puneboy123 4 หลายเดือนก่อน

      What about embedded macro and control buttons to save, refresh, Delete ,Add new?

  • @ammadkangatabdulla8775
    @ammadkangatabdulla8775 2 ปีที่แล้ว +2

    Fantastic presentation clear and simple.

  • @davegoodo3603
    @davegoodo3603 5 หลายเดือนก่อน +1

    Thanks Sean.

  • @MBTilak-sr4uf
    @MBTilak-sr4uf 2 ปีที่แล้ว +1

    Thank you Sir. Explained very clearly.

  • @awgldk8141
    @awgldk8141 ปีที่แล้ว +1

    Really useful! Thanks a lot.

  • @wizardmaster6639
    @wizardmaster6639 2 ปีที่แล้ว +2

    Sean - this was very clear - thanks

  • @birasagermain7293
    @birasagermain7293 ปีที่แล้ว +1

    Dear Sir Sean I like the way you teach; thanks really

  • @farinatty
    @farinatty 3 ปีที่แล้ว +2

    Great explanation. Normalising the source data by creating separate tables for country and region state would speed process and avoid having to use distinct statement in SQL.

  • @dazzil100
    @dazzil100 6 หลายเดือนก่อน +1

    Thanks Man !!!

  • @santars2030
    @santars2030 3 ปีที่แล้ว +1

    Thank a lot, explained easy

  • @garcimat
    @garcimat 2 ปีที่แล้ว +1

    You are the best Thank you very much

  • @Waberduggi
    @Waberduggi 2 ปีที่แล้ว +1

    Thank you very much

  • @veliyathuab
    @veliyathuab 2 ปีที่แล้ว +1

    Excellent

  • @omersharif3823
    @omersharif3823 3 ปีที่แล้ว +1

    Thanks Sir. This would have been incredible challenge without you.

  • @mahmoodalhatem6710
    @mahmoodalhatem6710 ปีที่แล้ว +1

    Thank you Sir

  • @bengtgudmundsson5418
    @bengtgudmundsson5418 ปีที่แล้ว +1

    Great tutorial, thank you, I try to figure out how to show the country, subcountry and city as you do but save the Primary key ID in the table I am populating with my form.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว +1

      Nice! You can set the Control Source of the final combo to a field in your table, if you want to save that final choice's ID.

    • @bengtgudmundsson5418
      @bengtgudmundsson5418 ปีที่แล้ว +1

      @@seanmackenziedataengineering Thanks, working on it now

    • @bengtgudmundsson5418
      @bengtgudmundsson5418 ปีที่แล้ว

      @@seanmackenziedataengineering Worked very well, thanks. Now I have another obstacle and would really appreciate your advise. I have three combo boxes in a form and they all show text strings and store primary key values(1,2,3......) into three different fields in a table. Needed to store values for all three fields since 2nd and 3rd option sometimes lack text strings. The source data for the combo boxes are taken from a similar table as you have in your example. My issue is that when I load the form the text string is only shown in two of my combo boxes, the third (actually the middle one) is blank. If I modify the blank combo box to show the primary ID it works. Any idea how to solve this?

  • @abdulhamidalhaddadi2255
    @abdulhamidalhaddadi2255 2 ปีที่แล้ว +1

    Thank you

  • @yalcnsofulu675
    @yalcnsofulu675 2 ปีที่แล้ว +2

    All perfectly. But one question remains. How can I use these fields for every record in the database?
    For example, in a database, I would like that I could use this data personally

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      Good question! If you wanted, you could set up various configurations that would filter your database for you.

  • @Burnt_Toast1469
    @Burnt_Toast1469 2 ปีที่แล้ว +2

    Great video! It really was easy to follow and understand. One question tho, for the set up you had it worked great if you go in order but how would you set it up if you have say 20 combo boxes bud filter randomly through them. Is there a way to do this method you showed in the video? Hope you can shed some light on this!! :)

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว +1

      I saw you posted on the Combo Search Form video about this. Actually this is pretty common, once people start to feel the power of the combo! There are a few ways to do it. You can create a table with all of the names of your combos in it. When the after update occurs, you can loop through the list of combos and build your sql or filter string, checking each combo for an entry as you go. To loop through records try this: th-cam.com/video/7HckYjH_wg4/w-d-xo.html
      A different way to do it is to make sure that you properly name all of your combos and text fields you use to build your filter string. Then, each time a selection is made, you can loop through the "control" collection on the form, and when you find a control with its name starting with cbo or txt, then check for a value in that control and add it to the filter using code similar to what you saw in the Combo Search Form video. Good ideas for a video - a little more in-depth :-)

    • @Burnt_Toast1469
      @Burnt_Toast1469 2 ปีที่แล้ว +1

      Thanks so much for taking the time and answering my question! You’re amazing!

  • @frankpierce1924
    @frankpierce1924 2 ปีที่แล้ว +2

    I really learned from your video. Thank You! I was wondering if you, please, could show how to display another field in the cities database after you select the Country, Region and City, for example display the population? or Assuming there is a table of images with an image associated with each city display that image. Really appreciate your tutorials. Not interested in saving the population or image just displaying it in the form

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      Good question! For the population, you can simply add that field into the query for the city drop-down, but leave the column width as zero. Then, you have the city and another hidden column in the drop down list. When you select the city, on the after update event just get the value of the hidden column of the drop down (which you already loaded) and display it on the form.
      Me!txtPopulation = Me!cboCity.Column(2)
      Something like that.

  • @arthurgrajeda
    @arthurgrajeda 2 ปีที่แล้ว +2

    Sean, I have a cascading combo box setup., however on the third box, sometimes I provide a hyperlink. Is there a way that when the 3rd box populates, it would allow a hyperlink to be pressed or have a button that will recognize the link and the user can hit go and it would go to that website?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      You sure can! You could put a button with two lines for Click:
      If IsNull(Me!cboMyCombo3) Then Exit Sub
      Application.FollowHyperlink Me!cboMyCombo3

  • @MariaGarcia-je6qb
    @MariaGarcia-je6qb หลายเดือนก่อน +1

    Me sirvió!! Muchas gracias. No obstante, no se guarda en el formulario :(

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  หลายเดือนก่อน

      Si configura la propiedad RecordSource para ComboBox, guardará la elección. ¡Buena suerte!

  • @Only-a-Guess
    @Only-a-Guess ปีที่แล้ว +1

    Hi, I have used this again and it works perfectly other than when the after update runs the cascaded field still retains information in it rather than being blanked out as it does in your video have I missed something, Thanks

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว +1

      I'm glad it worked! To do that final step, you need to make sure the control's value is set to Null in the code. ie. Me!cboMyCombo = Null
      You can post your code if you like and we can take a look.

    • @Only-a-Guess
      @Only-a-Guess ปีที่แล้ว +1

      @@seanmackenziedataengineering Thanks for that it worked great

  • @Billy-np5cz
    @Billy-np5cz 3 ปีที่แล้ว +2

    In order to create these drop down menus, does all the columns have to have the information or can relationships be created that associate the columns if they are in multiple tables. For instance if one table is a single column of 3 items, and another table associated to those 3 items is 24 items long?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Good question. You can do it - just do a Select on the second table where the value for the first is from the first table. You don't need any formal relationships.

  • @ajito079
    @ajito079 3 ปีที่แล้ว +3

    Thank you very much for the video. Very useful and well explained!
    Just a question. If the "City" field contains only one value, is it possible for it to appear automatically in that field? For example, at minute 14:13 the only value is "Charlottetown" but you have to click on the dropdown and then select it so that it appears in the "City" field.
    I think that if, in the case of a single value, the field was completed automatically, it could speed up a lot!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +2

      That is a great question! Users will find that very handy. All you need to do is add one line after you set the RowSource, to check the ListCount property. Just add:
      If Me!cboCity.ListCount = 1 Then Me!cboCity = Me!cboCity.Column(0,0)
      This line simply retrieves the first (and only!) value in the list if there is one row in the list. After this, when there is only one value in the city list, users will see it pre-selected!

    • @ajito079
      @ajito079 3 ปีที่แล้ว

      @@seanmackenziedataengineering Thank you!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +1

      No problem! Good luck on your project.

  • @shafiqueahmad9024
    @shafiqueahmad9024 3 ปีที่แล้ว +1

    I Will Follow You Like A Student

  • @nicolehayek9880
    @nicolehayek9880 2 ปีที่แล้ว +2

    this is simply amazing !
    is there a way to use the cascading combo boxes to filter a table ? and get the values that matches the values selected in the combo boxes ?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      Yes you can! You could use a query for this. In your query design, select each of the fields in the table, then in the criteria row, put in the expression referencing your combo boxes. For example, Forms!MyForm!cboCountry. Then, each time you open the query, it will look for the values you chose in your combo boxes.

    • @nicolehayek9880
      @nicolehayek9880 2 ปีที่แล้ว

      @@seanmackenziedataengineering worked like a charm ! thank you :D

    • @katherinemikesell9727
      @katherinemikesell9727 2 ปีที่แล้ว

      @@seanmackenziedataengineering Hi! Could you please explain this in a little more detail? I have the combo boxes working, but I'm not sure how to connect the query so I can display the filtered table? Thank you!

  • @santars2030
    @santars2030 3 ปีที่แล้ว +1

    Excellent guided, but I am facing some problem with while using it in sub form, as we applied settings in form which can not be operated WHILE USING IT AS sub form , so pls guide how to rectify

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      If you mean that one combo is on a form and another combo is on a subform:
      In the After_Update of the combo on the parent, use
      Me!SubformName.Form("SubFormCombo").RowSource = Me!SubformName.Form("SubFormCombo").RowSource
      If you mean that the combo to refresh is on the parent, in the After_Update for SubFormCombo (in the subform code, not parent) use
      Me.Parent.Form("ParentComboName").RowSource = Me.Parent.Form("ParentComboName").RowSource

  • @diamandashopen9331
    @diamandashopen9331 3 ปีที่แล้ว

    When I select a post in the first combobox i would like to the second combobox to be empty. I dont want previously region to be shown. How do I do that??

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Good question! You can certainly do this, watch from 13:10 and you'll see how to do this. We refine the technique as we go.

  • @sundarambm3666
    @sundarambm3666 6 หลายเดือนก่อน +1

    I would like to learn multiple dropdown with combo box example like when particular state is selected the respective district should get listed down in another combo. kindly help in this regards

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  6 หลายเดือนก่อน

      Great suggestion! You can accomplish it with the techniques in this video. Go for it!

  • @alexandermichaelis5627
    @alexandermichaelis5627 2 ปีที่แล้ว +2

    Thank you for the helpful video. Is it possible to apply the cascade from to field onto one combo box? For example, let’s say we had the population for certain cities (not all have the data) by year. Can you filter the city combo box by region/state and year (assuming you had another field for year in the form)?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว +1

      Yes you can! You can set up the combo with any filters you want. You will just change the filter string to look at the other text fields.

    • @alexandermichaelis5627
      @alexandermichaelis5627 2 ปีที่แล้ว

      @@seanmackenziedataengineering would you write the same rowsource = rowsource code for the year in the StateRegion after update event?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      @@alexandermichaelis5627 that's right!

  • @Only-a-Guess
    @Only-a-Guess 2 ปีที่แล้ว +1

    Hi, I used your video to make a cascading combo box for an equipment inspection database can I use this form as a subform as is or would I need to do anything different if it is in a subform. thanks

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว +1

      Yes you can! If you reference the subform, you may need to add one step:
      Forms!MyForm!MySubform!cboMyCombo
      Also you can see how to reference here:
      th-cam.com/video/7x06xjEjQ78/w-d-xo.html

  • @lion_0077
    @lion_0077 ปีที่แล้ว +1

    How to make search box as(while) we type at that time filter form(on that second filter form)??

  • @melinagrandmont7105
    @melinagrandmont7105 2 ปีที่แล้ว +2

    Hi, thank you so much for this tutorial! I got it to work and store the data I needed in a separate table. While the cascading drop-down lists work and I wrote the code builder with the 'after updates' as shown in the video, I am getting an error each time I select a value for one of the combo boxes on the form interface. The error reads as follows:
    Microsoft Visual Basic
    Run-time error '2465':
    Microsoft Access can't find the field 'Level_2_Title_Combo' referred to in your expression.
    I then have the option to 'End' or 'Debug'. If I click 'End', I can continue with the remaining cascading drop-downs (and get the same error each time), and if I click 'Debug', it takes me back to the Code Builder and highlights the code line in question. I checked for typos and can't find any, so I am unsure what is causing this recurring error.
    Would you have some insight to provide? Thanks!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว +1

      I see! Ok, you need to go to the properties on each of your combo boxes, then the Other tab, then the Name property. Does it match exactly to Level_2_Title_Combo, or does it say something else? This is your first check, because Access is looking for that field or control and it cannot find it. If you like, post your code and I will look.

    • @melinagrandmont7105
      @melinagrandmont7105 2 ปีที่แล้ว +1

      @@seanmackenziedataengineering Thank you for your response! It turns out I had named the combo boxes with spaces (i.e. Level 2 Title_Combo) but the code automatically replaced these spaces with underscores, so it seems to have created a disconnect. I just tried adding the underscores to the name under properties as you suggested, and now everything works flawlessly!! Will remember not to add spaces in the future :)

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว +1

      @@melinagrandmont7105 glad that you got it!

  • @jungjungdelosreyes4147
    @jungjungdelosreyes4147 3 ปีที่แล้ว

    sir, do we have a linked to download the MS Access file samples. Great video, thank you much and more power.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Hi, you can get the data file for cities in the video description. From there, you can make a new Access file and follow the instructions. Have fun!

  • @nemo9396
    @nemo9396 3 ปีที่แล้ว +1

    How do you make a form that loads up different forms depending on a previous choice?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +1

      Thanks for your question;; to do this, you can make some VBA for your "open" button. In the VBA, you can check the selected values on the form and then open a different form for many combinations.
      ex.
      If Me!txtDivision = 1 And Me!cboDifficultyLevel = "Low" Then
      DoCmd.OpenForm "frmEasyEntry"
      Else
      DoCmd.OpenForm "frmNormalEntry"
      End If
      Or, if you have many selections and forms, you can use Select Case. Check out this video to see a demo:
      th-cam.com/video/E5HbVmxHxSQ/w-d-xo.html

  • @shafiqueahmad9024
    @shafiqueahmad9024 3 ปีที่แล้ว +1

    Great... I am very GLAD to copy your Trick.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +1

      I’m glad it helped!

    • @shafiqueahmad9024
      @shafiqueahmad9024 3 ปีที่แล้ว +1

      @@seanmackenziedataengineering Sir But it not works with Bounded cbo. So please teach me how to store the selected data into a table from these Combo boxes

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +1

      You can certainly use this technique with a bound combo box. However, you'll need to first make sure your form is bound and has a Record Source on the Data tab in it's properties. Then, set the Control Source on the Data tab of the combo box properties. You will choose a field from your form's Record Source query or table. Then, it will be a bound combo box.

    • @shafiqueahmad9024
      @shafiqueahmad9024 3 ปีที่แล้ว

      @@seanmackenziedataengineeringSir. In Another Table Where Theses Values Are stored [CITIES]. Please Tell me how to prevent Duplicate Data Entering in CITIES Table. e.g I have a Table "ItemDefine" Item name[Country], Item Type[State], and Item Size[City]. These Three Column will Never Accept Same Value.

    • @shafiqueahmad9024
      @shafiqueahmad9024 3 ปีที่แล้ว

      @@seanmackenziedataengineering Sir. After Bounding The Combo Box on Query Builder as i Type DISTINCT in SQL View the Combo Box is not showing any value and if i add ID(Primery Key) it Shows the values but not in Distinct

  • @davidskilbeck588
    @davidskilbeck588 ปีที่แล้ว +1

    Hi, would this work if this form is of a continuous type?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว +1

      No, continuous forms will be difficult because every "form" in the detail section will change each time you select in one row of the combo.

  • @dbdata9836
    @dbdata9836 2 ปีที่แล้ว +1

    thanks

  • @tutsecret499
    @tutsecret499 2 ปีที่แล้ว +1

    How can I make dropping the box list without clicking on the arrow, instead when I tab to next field, I want the box list drops automatically to see the contents inside and I choose/type in the field. Example: in the boxlist there are this: 1-Completed treatment, 2-Pending Treatment, 3-Not eligible, 4-Expired and so forth. I have 9 items to choose from and I never know by hard the menu. It hurts the hands when I click to much over and over on the arrow dropbox when updating 100 rows.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      You can cause the combo box to automatically drop down: Me!cboWhatever.DropDown
      Put this in the after update or on exit of the field previous to this combo box. Good luck!

  • @jean-luccomtois8483
    @jean-luccomtois8483 3 ปีที่แล้ว +2

    Great video, thank you!
    I would like to know if it is possible to enter only a few letters and that the list will update no matter where the text is. LIKE Contains in Excel.
    Example:
    If in the contry field I enter "nia", we would have "Albania ... Armenia ..."
    Thank again Sean!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      This is a great question, and a good candidate for a future video. Yes, you can do this with a bit of coding. Essentially, you take the typed contents using the key events (ex. key down, key up) and then update the row source of the combo box with a SQL statement that uses LIKE '*nia*' (your example). Or for ODBC tables this may be LIKE '%nia%'. You may also use ALIKE '%nia%' for some cases.

    • @jean-luccomtois8483
      @jean-luccomtois8483 3 ปีที่แล้ว +1

      Thks! Hope you will do another good video! ;)))

  • @Rhythm515
    @Rhythm515 ปีที่แล้ว +1

    This is a great tutorial ~ Question, what happens when the first Cmb creates a list in the second Cmb that has the same value. E.g., you select criteria A in the first Cmb and you get the list 2,4,6,8 in the second Cmb. Then you select criteria B in the first Cmb and you get the list 1,3,5,7,8 in the second Cmb. If you select 8 from the second Cmb how will the third Cmb know which first Cmb criteria to pull? It seems to me it will pull all of the 8's from both criteria A & B you selected in the first Cmb.
    If I am correct, how can you fix it? And if I'm wrong, can you provide an explanation - I am dealing with this exact scenario and it is causing me to want to drive on the sidewalk ;) Thanks Sean...

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว +1

      That's a great question! The reason it doesn't get screwed up is because when you change from A to B in the first combo, the list actually changes to the proper subset. So, if 8 is actually belonging to A and B, then just select 8, and the subset of 8 will appear in the third combo. In many cases, it is possible for 8 to belong under A, B, and C, so this is the desired operation. ie. Choose a car door, sub assembly for two different car doors include the same window G1, etc.

  • @zoom2suraj
    @zoom2suraj 5 วันที่ผ่านมา +1

    👍

  • @baseer4371
    @baseer4371 ปีที่แล้ว +1

    Hi there , It value save table data?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว

      Good question! Yes, you can set the ControlSource for a combobox, and it will save the data in your table.

  • @m.albayati5925
    @m.albayati5925 2 ปีที่แล้ว +1

    Hello Sean,
    I tried to do it, but I got an issue. I have 10 records and if I change the city or country on one of them it will change the cities and countries for the other 9 records!! :)
    Where should the selected info ( cities and countries) be saved, on which table?
    Thank you,

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      You're probably using this technique on "continuous forms" instead of "columnar forms". You'll notice in this video that my combo boxes are "unbound", meaning they are not connected to a field in the database. This is useful on columnar forms only, where many records aren't shown at once. This is a limitation of Access forms. If you have a list (continuous forms), perhaps put a button for "Edit" that will open a single form (columnar) with all the data nicely displayed for that record. Then you can use cascading combos for cities etc.

    • @m.albayati5925
      @m.albayati5925 2 ปีที่แล้ว

      Thank you so much for your help

  • @tk5883
    @tk5883 2 ปีที่แล้ว +1

    I have 4 tables with different data in them. I have set up the combo boxes and now I would like to be able to take the data selected from the combo boxes and input on another form. Is this possible. I want to be able to select from each box and then each boxes data populate to another form or maybe easier to input on the same form. I need to be able to select the details of an assignment then create a new set of assignments based on the boxes. If this confusing I am sorry.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      You sure can! Just create a button on your form, then in On Click you can do something like:
      DoCmd.OpenForm "frmAssignments", acNormal, , , acFormAdd
      Forms!frmAssignments!txtMyField1 = Me!cboValue1
      Forms!frmAssignments!txtMyField2 = Me!cboValue2
      Forms!frmAssignments!txtMyField3 = Me!cboValue3
      Forms!frmAssignments!txtMyField4 = Me!cboValue4
      DoCmd.Close acForm, Me.Name 'If you want to close the selection form
      That will open your assignments form on a new record, fill the four values (you have to change the field and combo box names to yours), then close itself. To get you started!

    • @tk5883
      @tk5883 2 ปีที่แล้ว

      @@seanmackenziedataengineering Thank you I appreciate the assistance. I tried it and it didn't work I don't think I have it set up correctly. I will continue to work with it and see.

    • @tk5883
      @tk5883 2 ปีที่แล้ว +1

      @@seanmackenziedataengineering I figured it out Thank you, but we decided to use this setup with a sub-form and now it won't work. Any tips????

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      @@tk5883 If all of the combos are on the subform, then just add the subform name like:
      Forms!MyForm!MySubform!cboMyCombo
      You can see more about parent to child subforms here: th-cam.com/video/7x06xjEjQ78/w-d-xo.html

  • @shawnritter3911
    @shawnritter3911 2 ปีที่แล้ว +1

    I found that Me!cboRegionState = Null, throws an error, however I did find a workaround Me.Requery or Me.Recalc

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      Glad that worked for you! You can also use some code to check for nulls in advance and then decide what to do.

  • @shafiqueahmad9024
    @shafiqueahmad9024 3 ปีที่แล้ว

    Sir. I have a problem with my keyboard layout. how to change automatically my keyboard layout in some fields

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +1

      This is a very interesting topic! I know that some have done similar things before. Here is an older but neat article: bytes.com/topic/access/insights/908560-how-implement-multi-lingual-database

    • @shafiqueahmad9024
      @shafiqueahmad9024 3 ปีที่แล้ว

      @@seanmackenziedataengineering . difficult to understand this article.

  • @jalaluddin8276
    @jalaluddin8276 ปีที่แล้ว +1

    Thank you very much Sean for your help.
    I would like to email you my db on loan module.
    Thank you once again.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว

      You can send it - make sure to join me here too:
      patreon.com/mackenziedataengineering
      Thanks

  • @KS-xd6ql
    @KS-xd6ql 2 ปีที่แล้ว +1

    Hmm I learned this using "requery" in the update event. Is your way superior?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      In some (rare) cases that I observed over the years, requery/refresh will not update the combo box data. Setting RowSource = RowSource was the only method that would properly force a requery in every case.

  • @satyabanukil779
    @satyabanukil779 3 ปีที่แล้ว +1

    I have a tabular form with a combo box. For instance, I have two
    records in that combo box "John" and "Jack". Now I want to add another
    name to that which I can select henceforth and the combo box shall now
    show three records instead of the initial two. It is possible. Kindly
    suggest.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      It sounds like you want to add a selection "on-the-fly", when the form is open, and not in design view. All you need to do is insert a new name record into the table that is the source for your combo box, then refresh the combo box using the method in this video.
      For example, you could do this on the "double-click" event of your combo box. Whenever someone double-clicked the box, a pop up would ask the user to type in a name. After they clicked "OK" to add the new name, the code would insert a record in the table and then refresh the combo. The new selection list would be presented.
      First, open the form in design view and click on your combo box. Open properties and find events, then "DoubleClick", then click the ellipsis (three dots) to open that event for coding. Then, make a text box called txtHiddenValue somewhere on your form and set the Visible property to False. This will give you a parameter to use.
      The coding would look something like:
      strInput = InputBox("Please enter a name.")
      Me!txtHiddenValue = strInput
      strSQL = "Insert Into NAME_LOOKUP_TABLE (Lookup_Name) Values (Forms!MyFormName!txtHiddenValue)"
      DoCmd.SetWarnings False 'Turns off the "are you sure" message
      DoCmd.RunSQL strSQL 'Insert the record
      DoCmd.SetWarnings True 'Turn warnings back on
      Me!cboMyCombo.RowSource = Me!cboMyCombo.RowSource 'Refresh the combo

    • @satyabanukil779
      @satyabanukil779 3 ปีที่แล้ว +1

      @@seanmackenziedataengineering Thnx a lot Sir. Definitely shall try your suggestion. Since in our country, we don't get such tips promptly. If you get time, kindly make a demo for doing this as after bringing the text box, how to connect it and define as text hidden value and finally how to create link between hidden txtbox with the combo box. My main table name is table1, form name form1 and name of the look up table lookupart1. Regards.

    • @satyabanukil779
      @satyabanukil779 3 ปีที่แล้ว +1

      Further tried with your code. Just changed table_name to Table1, Combo_Name to Combo5 as per the table I created for testing purpose. But primarily it allows me to enter data. then again a parameter comes after entering data into it, error message 3346 appears. So it is not working. My table structure has only two fields. ID and Name and I want to update the field Name through combo Box.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      I just posted a video for you to view, showing two ways of accomplishing this task. Check it out: th-cam.com/video/aaDpib_mYRA/w-d-xo.html Thanks for telling me about your project! Let me know how it goes.

    • @satyabanukil779
      @satyabanukil779 3 ปีที่แล้ว

      @@seanmackenziedataengineering Tried it Sir. Thnx a lot. But in my case, when I put new data in the prompted inputbox again a parameter appears and if I enter the same name again. It worked. But could not understand the additional step. Besides, creation of the lookup table and its structure could not be understood as without it the code will not work. Now if I create the first table (main table based on the form to be made) and assign any item as look up, then there are three options and if I choose "I want to lookup field to get..." then I have to link the lookup table. So I understand that Until I create the lookup table, nothing works and error message appears. Sir during the last two days, I have given you lot of trouble. Still when you asked for my feedback, I am to request you give a full demo from the scratch. The link which you have given where tables, combo box etc.are already created. I hope you understand the problem being faced by me. Regards.

  • @naderahmadi6217
    @naderahmadi6217 3 ปีที่แล้ว +1

    Hi, there
    I am gonna to make combo boxes on tables for Cities and States! is it possible? I don't want use form for making Combo boxes! if it's possible please guide me. thanks a lot.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      You can make drop-downs in the table. In design view on your table, click on a column, then the Lookup tab. Change the display control to Combo Box, set a table or list as the RowSource, and you're done!

    • @naderahmadi6217
      @naderahmadi6217 3 ปีที่แล้ว

      @@seanmackenziedataengineering Could you please Explain more about this method? is it possible make a video for to describe step by step! because I should add several changes in property sheet, and I don't know these Tricks.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      @@naderahmadi6217 stay tuned! I'm going to do a tutorial series on the basics this year. Cheers

    • @naderahmadi6217
      @naderahmadi6217 3 ปีที่แล้ว

      ​@@seanmackenziedataengineering Good luck. Thanks for your consideration.

  • @accessbyfarrukhshah
    @accessbyfarrukhshah 3 ปีที่แล้ว +1

    How we can use cascading combo box in continuous form? if we add 2nd record in continuous form using cascading combo box then the previous record is automatically invisible! can you make a video of it that how we can use cascading combo box in continuos form? thanks

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Continuous forms are pretty limited in this respect. When the rowsource is set, it is set for all of the visible rows. This is why your selections look like they disappear. You certainly *could* program a solution that looks like continuous forms and allowed this kind of selection, but it might be a lot of work! Maybe an idea for an advanced video. Thanks!

    • @accessbyfarrukhshah
      @accessbyfarrukhshah 3 ปีที่แล้ว

      @@seanmackenziedataengineering Thanks for the reply and I am keenly interested and waiting for, that you will make a video on it.

  • @santars2030
    @santars2030 3 ปีที่แล้ว

    Hi Sir, thanks for ur guidelines, just having one issue, I have been used ur coding, for 4 fields, but in some of 3rd field there r values from which 4the field easily appear, but in some cases 3rd field is empty then 4the field not appear, so how can I resolve this stage. Here I have to appear 4th feild though 3rd field is empty, Pls guide. Thanks

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Thanks for your comment. I'm not sure what the problem might be here. You have four cascading combo boxes that load in sequence?

    • @santars2030
      @santars2030 3 ปีที่แล้ว

      @@seanmackenziedataengineering yes sir. I have 4 combo box. 1st nd 2nd having value. And in 3rd box don't have value. But still I want 4th combo box value from 2nd combo box.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว +1

      @@santars2030 I checked your design. For your case, you will go to the SQL design in your 4th combo box (properties > rowsource), where you will see "Or" in the design grid. Currently you look for 3rd field in there. You can add your 2nd field/combo to the end, (on new row of "Or") then use Forms!MyForm!Combo2 for the "Or" entry. This says "Show me the 4th combo list for values in 3rd combo OR the value in the 2nd combo. Good luck!

    • @santars2030
      @santars2030 3 ปีที่แล้ว

      @@seanmackenziedataengineering Sir still not wored, pls check email all detail issue highlighted . Thanks

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      @@santars2030 Thanks for the screenshot. You were almost there! In this case, just remove the criteria expression from the DefectDetails "criteria". Also remove it from the "or" row for DefectDetails (both rows).
      Your first solution was different than I imagined. Good luck!

  • @alandonner3163
    @alandonner3163 2 ปีที่แล้ว +1

    do you have any videos on relationships

  • @greggsolomon3648
    @greggsolomon3648 11 หลายเดือนก่อน

    At 4:51 row source --- from there, the steps are not clear. He says row source. It hasn't updated. In his there is at the end of the field two icons, one I think is a downarrow the nect 3 dots. I only have 3 dots. He clicks I think 3 dots. Then a window opens- show table. This does not happen in my test file.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  11 หลายเดือนก่อน

      You need to make sure that you click on the drop-down (ie. it is selected) before you go to properties, otherwise it will show properties of some other object, like a text box or the form itself. Good luck!

    • @greggsolomon3648
      @greggsolomon3648 11 หลายเดือนก่อน

      Thank you. I'm going to give it ago --

  • @badredinedeghiche5848
    @badredinedeghiche5848 2 ปีที่แล้ว +1

    i like you man

  • @maureenreeder
    @maureenreeder 2 ปีที่แล้ว +1

    Ugh..I'm a beginner and don't know code. Sure this is great for those who do.

  • @santars2030
    @santars2030 3 ปีที่แล้ว

    Thanks for ur solution. Sir regarding my problem I sent my queery details via messenger. Pls acknowledge

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      Thanks - I received your msg on my website and here on YT. I will review..

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 ปีที่แล้ว

      This was a great exercise, thanks for bringing it forward!
      *EVERYONE PLEASE NOTE, IF YOU ARE USING YOUR CASCADING COMBOS ON A SUBFORM, THIS WILL HELP YOU*
      For this case, the "parameter" is broken when you use Form B as a subform.
      To fix it, go design view on Form B, then edit the RowSource for each of the affected combo boxes:
      Now it probably says something like Forms!FormB!FieldName
      It needs to "see" the field value when it is running, which means it is on the subform, so try:
      Forms!FormA!FormB!FieldName
      As you can see, you just insert FormA! into the string to look down one level on the forms, because FormB is running as a subform. It will only work when FormB is open as a subform to FormA.
      Of course, change FormA and FormB in the above to your form names.

  • @shafiqueahmad9024
    @shafiqueahmad9024 3 ปีที่แล้ว

    My language is URDU