Results 1 to 9 of 9
  1. #1
    jsmath22 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    4

    cascading combo boxes, .requery not working

    Hello,


    I am having a lot of problems with the mock database I am creating as a means of educating myself in Access. It is a disc gold ordering db. First, hit the "Place an Order" button and the frm_IntroOrder pops up. Within this form, the first combo box is used to select the Brand of the disc desired. I finally got that working (SELECT DISTINCT) and upon doing that, the next combo box (cmbType) should be filtered to only contain the Types of discs that Brand produces. I have the Row Source

    SELECT tbl_Discs.Type FROM tbl_Discs WHERE (((tbl_Discs.Type)=[forms]![frm_IntroOrder].[cmbBrand]));

    and the

    [code]
    Private Sub cmbBrand_AfterUpdate()
    Me!cmbType.Requery
    End Sub
    [\code]
    However, all it is showing is the first Type in tbl_Discs.

    SELECT DISTINCT tbl_Discs.Brand FROM tbl_Discs;


    Thanks for the Help,
    Very Beginner
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Wouldn't the type have to be included in the first combo so the second can reference it?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Reverse that; you're comparing type to brand, apples to oranges.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Change RowSource for cmbType to:

    SELECT DISTINCT tbl_Discs.Type FROM tbl_Discs WHERE (((tbl_Discs.Brand)=[cmbBrand]));

    Why is tbl_Discs the RecordSource for Order form instead of tbl_Order? tbl_Order does not have a field for ID of disc ordered. Why save customer info in tbl_Order? Could save just the CustomerID. Saving credit card numbers in database can be bad idea. Are you the ONLY user of this db?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I can't work with your database, it keeps not saving changes I make and I've run out of patience.

    Here's what I can tell you. You're going to have trouble with this database because you do not have it normalized.

    For instance, in your tbl_Discs you currently have 3 manufacturers, now what happens if you have 500 records in there and you have Latittude, Latitude and latintude. Whenever you do a search these will not be associated with 1 Manufacturer. What you really should have is a table for each one of your disk properties that are 'standard'

    Color, Brand, Type, Distance, Grade, Stability, etc. Any property of the discs that comes down to a 'standard' set of items should be given it's own table.

    Second. When you are performing your order, you do NOT want to put in all of those properties over again and further, your orders may consist of several disc type so you will want a primary ORDERS table and a sub table of ORDERDETAIL (for example) where the type of disc the person is order is entered. On that form you are going to want an unbound lookup (you are currently basing your 'orders' table on your tbl_Discs table which I assume is meant to be a list of potential discs someone could buy. That's not what you want.

    You'd likely want a main form/subform where the main form is based on your orders and your subform is based on the ORDERDETAIL table. On the subform form you could have your unbound search engine where you could put in any one of the properties in the tbl_Discs table and your list box/combo box would show you any items from tbl_Discs that mach your criteria.

  6. #6
    jsmath22 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    4

    Thank YOU!

    Quote Originally Posted by pbaldy View Post
    Reverse that; you're comparing type to brand, apples to oranges.
    Holy macaroni, that was a DUH moment. I knew it had to be something like that. Thank You!!

  7. #7
    jsmath22 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    4
    Oops, thank you for spotting that error, it works now!! This is just a mock database, there will be no real card #s in there, just trying to educate myself. However, I would still like to know how do companies save credit card numbers? OK, tbl_Discs is used as the Record source so that the user can pick the disc, which will give the unique id (or primary key, right?) for the disc they want to order. The key will then be entered into tbl_Order (which I just realized is not in there, again oops and thank you for pointing that out). Can you please explain the pitfall there? I did the customer shipping address in the tbl_Order b/c that may change for each order. For example if someone orders a lot of gifts on Amazon, they are all shipped to different addresses, which is not the same as the address of the customer. I'm trying to do the normalization thing, not repeating a customer in tbl_Customer every time they want the order shipped to a different address. Where should it be? Should I have another table called tbl_Shipping or something?
    Thank you so much for your help, sorry for all the additional questions, but I'm going to take advantage of your knowledge if you are willing to share :-)

    Thank You,
    Jessica

  8. #8
    jsmath22 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    4
    Quote Originally Posted by June7 View Post
    Change RowSource for cmbType to:

    SELECT DISTINCT tbl_Discs.Type FROM tbl_Discs WHERE (((tbl_Discs.Brand)=[cmbBrand]));

    Why is tbl_Discs the RecordSource for Order form instead of tbl_Order? tbl_Order does not have a field for ID of disc ordered. Why save customer info in tbl_Order? Could save just the CustomerID. Saving credit card numbers in database can be bad idea. Are you the ONLY user of this db?


    Thank You!! It works great now. This is a mock database, no actual credit cards in there. However, for my own education, where do companies store credit card #s? OK, so I use tbl_Discs for the Order form so that I can get the uique id of the disc to enter into tbl_Order (which has now been added, thanks for noticing that as well). What is the potential pitfall there? I have the shipping address in tbl_Order just in case the customer has several different shipping addresses. For instance if someone orders all their gifts to others on Amazon, then all orders would have a different shipping address which would not be the same as the customer's acutal address. How should I do it? Should i have another table, tbl_Shipping? Sorry for all the additional questions but if you are willing to share your knowledge, I'm going to take full advantage :-)

    Thank You,
    Jessica

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Order form should have tbl_Orders as RecordSource, tbl_Discs does not need to be in the RecordSource.

    Could have an Addresses table. Just depends on how much repeat business you get.

    Credit cards in databases is a touchy issue. You can encrypt the field in the table but still at risk. Anyone with access to the database can get around that. We know credit card companies have been hacked. My bank had to replace credit cards after one incident.

    I only worked in one business that kept CC info and they were all in a physical rolodex card file. If I remember right, every billing cycle the card number had to be entered for charge to credit card service.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cascading combo boxes
    By Jackie in forum Access
    Replies: 5
    Last Post: 07-26-2013, 09:07 AM
  2. Cascading Combo Boxes Requery Problem
    By Jo22 in forum Forms
    Replies: 9
    Last Post: 01-28-2012, 09:41 AM
  3. cascading combo boxes stop working in DAP system
    By James Brazill in forum Forms
    Replies: 5
    Last Post: 06-28-2011, 03:51 AM
  4. Help with Combo Boxes/requery....etc
    By noaccessguru in forum Forms
    Replies: 9
    Last Post: 06-06-2011, 05:50 PM
  5. Cascading Combo Boxes
    By desireemm1 in forum Programming
    Replies: 1
    Last Post: 10-05-2009, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums