Results 1 to 7 of 7
  1. #1
    Snoday is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    4

    Question How to Set Access Form RowSource to ## of records in VBA

    I am currently working with large datasets, running multiple queries against 12 tables, each table contains 700,000+ records. I am looking at a way to limit the number of records returned in queries to increase performance. I have been to a lot of web pages where you can look at records 1-25 then 26-50, then 51-75... Is it possible to replicate this type of behaviour utilizing an access form or query? I have been taking random stabs at this and can not figure out how to return recordsets that are extracted from a long list, but just a subset in the middle and a specified number of records long. Any chance a guru can point me in the right direction? Thank you for you patience and insight.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  3. #3
    Snoday is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    4
    The material you recommend i have reviewed and although it provides interesting ways to subset your data based on user inputs and make your forms more responsive by using a dynamic range for your row source on large record combo box. I still am unable to figure out an adaptation that would return specific record subsets of a recordset based on a screen combo field to display 10, 25, 50, 100 records at a time on the form. how do you get a recordset to pull the 51st to the 75th record to display for a rocord source of the form?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The thread title referenced RowSource which is for a combobox/listbox, not the RecordSource for a form. Never encountered this before and don't know what a solution could be.
    Last edited by June7; 05-07-2012 at 01:54 PM.
    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
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Just noticed this post. I'm not sure of an answer, but can you tell us more about the tables? Is there any field that identifies a specific record?

    If there is a field you could try something like
    Select........
    where thefield between xxxx and xxx+25

    There is no rownumber with access like there is with other dbms, but may be you have a field that could be used similarly.

  6. #6
    Snoday is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    4
    Thank you for your responses. I think Orange hit the nail on the head with comment access doesn't have a native row number feature. I had not thought about adding a rownumber field and repopulating based on the sequencing needed. I think it would allow me to replicate the pulling of records in a manner similar to the a web page drop box of show me ## records in user selected increments like 1-25 then 26-50, then 51-75. I will look at adding a rownumber field to the parent table and I will check the performance hit of renumbering the row for different sort orders and data subsets. The guys running using this database regularly had simply dedicated one terminal to running these queries and if they needed multiple data subsets would start them running on their computers prior to leaving for the evening. This project had been pushed way down my priority listing as the program provided the required functionality, just at a very slow pace. This came back on my plate for a minor change. While I’m making changes this time I'll add the rownumber and see whether renumbering the field based on filter and sort requirements will outweigh the ability to return a lot fewer records per screen view or if the query is simply slow because of the scope of the relationships between the large datasets.

  7. #7
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If you are not DELETING records, you might check out the "AbsolutePostition" property in VBA help. Open a recordset as a snapshot (so the positions won't change) and you could select "groups" of records.


    Just an idea........
    Last edited by ssanfu; 05-07-2012 at 05:41 PM. Reason: computer can't type

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

Similar Threads

  1. .RowSource Combo
    By white_flag in forum Access
    Replies: 1
    Last Post: 09-06-2011, 07:59 AM
  2. RowSource Value not writing to the Table
    By tbassngal in forum Queries
    Replies: 5
    Last Post: 09-03-2011, 12:16 PM
  3. combobox rowsource
    By dirkvw in forum Forms
    Replies: 3
    Last Post: 06-20-2011, 05:12 PM
  4. SQL Rowsource
    By DSTR3 in forum Queries
    Replies: 2
    Last Post: 12-06-2010, 11:06 AM
  5. Replies: 1
    Last Post: 11-01-2010, 06:59 PM

Tags for this Thread

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