Results 1 to 7 of 7
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Requerying Combo Box

    Why do I struggle so much in getting my Combo Boxes to Requery? In the 'Events Tab" where do I put my requery expression? Isn't in "AfterUpdate?"

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If you are referring to cascading combo boxes, I use the after update event of the primary (first) combo box.

  3. #3
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    What is cascading combo boxes? Here's what I have:
    Private Sub Combo44_AfterUpdate()
    Me.Combo44.Requery
    End Sub

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    cascading combo boxes: See http://access.mvps.org/access/forms/frm0028.htm

    Why are you trying to requery the same combo box you just made a selection in?

  5. #5
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Quote Originally Posted by ssanfu View Post
    cascading combo boxes: See http://access.mvps.org/access/forms/frm0028.htm

    Why are you trying to requery the same combo box you just made a selection in?
    In my Combo Box I have the 'CustomerrsID' & the 'NumofVehiclesPurchased.' Now the Combo Box is from a query that list all of my customers who have yet purchased a vehicle. So, when I choose/assign a CustomerID to a vehicle (a Sale) when I go to the next Record & need to pick another Customer ID from my Combo Box I just want to ONLY see those customersid who have "0" Vehicles. Might you be following me a little?

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    What is the row source of the combo box? Something like

    SELECT CustomerrsID, NumofVehiclesPurchased FROM tblCustomers WHERE NumofVehiclesPurchased = 0



    When you move to a different record, the combo box should be refreshed (requeried).
    You might try
    Code:
    Private Sub Form_Current()
       Me.Combo44.Requery
    End Sub

  7. #7
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    I tried pasting your code & it didn't work I get an error

    Here's the Row Source: SELECT [Customers CountOfVehicles (0)].[CustomerID], [Customers CountOfVehicles (0)].[Age], [Customers CountOfVehicles (0)].[MonthlyIncome] FROM [Customers CountOfVehicles (0)];

    Maybe I need to eliminate the 'Age' & the 'MonthlyIncome'? Could that bbe the issue?


    I tried it with just the customersID ALONE! Still NOT working for me

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

Similar Threads

  1. Replies: 6
    Last Post: 11-18-2012, 05:06 PM
  2. Replies: 1
    Last Post: 10-30-2012, 10:29 AM
  3. Replies: 6
    Last Post: 10-15-2012, 01:49 PM
  4. Replies: 2
    Last Post: 08-16-2012, 10:02 PM
  5. Search Box Requerying Subform problem
    By cbh35711 in forum Access
    Replies: 1
    Last Post: 03-30-2012, 09:37 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