Results 1 to 4 of 4
  1. #1
    Datech is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    40

    Displaying Records and the Count

    I'm not sure if this is better suited for queries or forms, so I'm dumping it here.




    • I have a continuous form (frmEmployeeVis) that displays the records in the form's Record Source (SELECT (whatever) FROM dbo_EmployeeData). One of these fields, NotActive, can be edited for each record and affects how that record displays elsewhere in my DB.
    • I have a query (qCurrentHC) that counts all of the records in dbo_Employee data where NotActive equals False (SELECT Count(*) FROM dbo_Employee Data WHERE (dbo_EmployeeData.NotActive="False")
    • Right now, I have a List Box that displays the result of the qCurrentHC query, where the row source simply selects the only value


    It all works fine. The records display, the query runs, and the list box displays the number. However, if I change any of the NotActive values and hit update (Me.Requery on the frmEmployeeVis), the qCurrentHC query obviously doesn't update since it isn't the form's record source. If I open any of my other forms with qCurrentHC displayed in this manner, or reopen this form it will update since it'll rerun the query then.

    How do I get the query to rerun when I update this field on that form? I feel like I'm approaching the problem wrong from the beginning, and there is no reason behind how I did it aside from it was the first thing that *almost* worked. Any help is appreciated as always.
    Last edited by Datech; 07-18-2012 at 05:41 AM. Reason: herp derp

  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,518
    You should be able to requery the listbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Datech is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    40
    Quote Originally Posted by pbaldy View Post
    You should be able to requery the listbox.
    I put the List Box requery before the form requery, so it wouldn't catch the update /facepalm. Switch the list requery to after the form requery and it works fine. Thanks!

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

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

Similar Threads

  1. Displaying multiple records in a report.
    By CammRobb in forum Queries
    Replies: 10
    Last Post: 07-23-2012, 06:44 PM
  2. Displaying Count if Null value exists
    By adams.bria in forum Queries
    Replies: 3
    Last Post: 08-31-2011, 11:56 AM
  3. Displaying Records & Sorting Help
    By raceware in forum Access
    Replies: 1
    Last Post: 09-29-2010, 06:35 AM
  4. Best way of displaying and printing records?
    By Orabidoo in forum Access
    Replies: 1
    Last Post: 05-11-2009, 10:05 AM
  5. Displaying records from a form
    By ceb39 in forum Access
    Replies: 5
    Last Post: 04-03-2009, 12:36 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