Results 1 to 11 of 11
  1. #1
    Join Date
    Jun 2008
    Posts
    59

    Red face Unanswered: Number Records In A Query

    Can Anyone Help I Have A Form Showing 2 Tables Based On Queries.i Move The Contents Of The Queries From One To The Other Using A Unique Number For Each Record.this All Works Fine!
    Now I Want To Have A Running Number Of Each Tables Number Of Records After Each Move

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    hi dennis, welcome to dbforums

    seems like you might have a question

    first thing you ahve to do is realize that at dbforums, we have separate forums for each database

    i'm gonna guess your database is ms access, so that's really where you should be posting your question

    when you do, you might want to give just a wee bit more information besides "A Form Showing 2 Tables Based On Queries"

    you might also explain just how you "Move The Contents Of The Queries From One To The Other" because as far as i know, you cannot move anything into a query
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2008
    Posts
    59
    Thanks Rudy as you can tell i am new to this forum stuff but am impressed with prompt replies from around the world.
    how do i transfer my post into access forum?
    i have two list boxes unbound in my form and using an add-in drag-n-drop programme i can move the selected names between the two tables,using the queries as my source in the list boxes,and that is where i need to show number of records saved in each list box after movement of the names
    does this help to make sense rgds dennis

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    it makes absolutely no sense to me, but that's because i don't do access forms

    however, i can move the thread for you
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Sounds to me like you just need a count function to summarise each list box.

    A text box could show this if it is set:

    Me.TextBoxName = Me.ListboxName.ListCount
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Jun 2008
    Posts
    59
    thank you startrekker.you make it sound so easy!sorry to sound stupid but you obviously mean to create a text box for each list box,but can you explain how to "set up " these list boxes with the details to make the count function work
    rgds dennis very much an access newbie!

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Ok... bear in mind that I am assuming a little here. Assuming you have a list box called ListboxA and another called ListboxB, then you should create a small Textbox under ListboxA, perhaps called txtListCountA and another underneath ListboxB, called txtListCountB.

    Now, this is where it gets a touch tricky because I have no idea how this drag and drop thingo works, but you need to get these text boxes to show the counts for their respective listboxes.

    I'll go with a safe bet to start with. Place a command button on the form, perhaps between the two text boxes. Call it cmdUpdateCounters.

    Next, right click the cmdUpdateCounters and select Build Event.
    Choose Code Builder and click OK.

    Copy the following code to where the cursor is:

    Me.txtListCountA = Me.ListboxA.ListCount
    Me.txtListCountB = Me.ListboxB.ListCount


    Close down the coding window and run your form.

    If all goes well, you should be able to now click the command button at any time to get the textboxes to show the correct number of entries in each listbox.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Jun 2008
    Posts
    59

    Smile Number Of Records

    HI1startrekker,has anybody told you how good you are today??or any other time!
    i followed your step by step instructions,and now have a count update command button which shows running totals of both lists without interfering with my drag-n-drop
    many thanks for your help
    rgds dennis

  9. #9
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049


    You're most welcome!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  10. #10
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    We need more users like dennis 2756, heh StarTrekker?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  11. #11
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Agreed Posts like number 8 here are our "pay"
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •