Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130

    So I have gotten rid of all of my lookups and I am trying to cascade the combobox once again, but it is still not working. What I want to happen is that once the 'CustomerNamecbo' is updated, I would like the 'PartNumbercbo' to requery accordingly. It keeps asking me to enter parameter values once I click on 'PartNumbercbo'
    Code:
    Private Sub CustomerNamecbo_AfterUpdate()    
        Dim strSource As String
        strSource = "SELECT ActiveParts.PartNumber, ActiveParts.PartNumber " & _
                       "FROM ActiveParts " & _
                       "WHERE CompanyName = '" & Me.CustomerNamecbo & "' ORDER BY ActiveParts.PartNumber"
    
        Me.PartNumbercbo.RowSource = strSource
        Me.PartNumbercbo = vbNullString
    
    
    End Sub

  2. #17
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    I usually don't us VBA for my combo boxes.
    I will add the SQL into the row source and use the where clause to reference the previous combo box.

    Your method is good also. Same thing, just different.

    Code:
    "WHERE CompanyName = '" & Me.CustomerNamecbo & "' ORDER BY ActiveParts.PartNumber"

    Is CustomerNamecbo text? remember you are looking at the bound field in a combo.
    Take a look at the CustomerNamecbo and make sure the first field is text and not the ID of the record.



    Dale

  3. #18
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    It is the ID of the record. Does that mean it will not be possible to do?

  4. #19
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    I know this is an older thread, but I have done a lot more on my database and I have come back to the same problem with cascading comboboxes repeatedly. None of the resources provided have allowed me to accomplish my goal and I am wondering if my relationships setup is limiting how my combo boxes will work. If anyone can help me out with this, I would be very appreciative. Here is my file, just in case anyone wants to look for themselves. It is on the incoming form and I have tried running the commands in VBA and with SQL in the row source, but nothing has worked. I am trying to get the CustomerName (first combobox) to limit which PartNumbers are available for selection (second combobox). Or if there is another way to do this, that would be great as well. Thanks in advance!

    New Compressed (zipped) Folder.zip

  5. #20
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #21
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    dylcon, I just answered this in your other thread.
    Maybe you should close this one.

    Dale

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  2. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  3. Replies: 5
    Last Post: 07-23-2011, 11:48 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

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