Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98

    ListBox not showing correct stating point

    I have a database I built in test mode and now my main table has been populated with the live data. There are 1.3 millions rows. I built a form that has a search button and the ability to sort through records looking at searching by just about whatever they want and it will filter and show details in a listbox. The problem is, I used fake information for testing. I wrote over the first 46 lines so that the PK beginning with 1 has the REAL data. Or LIVE data I guess you could say. Then it goes to row 1,300,086. When I see my listbox view, the listbox is not beginning with line 1. It begins with line 46. I do not understand this because I wrote over lines 1-46. I have sort ascending by the primary key in the row source. The row source is a select query statement. Instead of a select statement here, would it be better to create a query and store it so it captures rows 1-46 as well or do I have to rebuild the table from scratch and append my data?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    SQL or query as RowSource shouldn't make a difference.

    I don't understand, if only the 46 records are 'real' data, why is there 1.3 million rows?

    Have you run Compact & Repair?
    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
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    No. 46 records were used for testing. Now they wanted me to load the REAL data that is the 1.3 million rows. So, I copied and pasted 1-46 from real data, then I appended the remaining of the 1.3 millions rows. I have compacted and repaired. I have even create a blank database, created the table from scratch and then appended my live data and it still keeps reverting to beginning at row 46. Row 1 has no null values, there are null values in 8 of the first 46 but only a few columns are null. My PK of course always appears. Is there a way to say no matter what make all rows appear based on the PK is not null?

  4. #4
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    I only mention the null because I review the listbox and not 1 column contains a null value. I have 16 rows to display in this listbox.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Why would PK be null? Is the PK an autonumber field?

    I don't understand what is going on. If you want to delete most of the 1.3 million records (because the db is probably too large for forum post even in zip), leaving the problem records plus some good ones, and provide db for analysis, will take a look.
    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.

  6. #6
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    The PK is not null. It is autonumber. I cannot post it. Work PHI violation. Healthcare.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Could sanitize the db. Make copy and delete sensitive info (name, address, phone, ssn, email).

    Data imported from what source?
    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.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    ??? Confused but I will throw this out there.

    If you want your AutoNumber to start with 1, copy paste the table. Use the option for "Structure Only". Do a compact and repair for good measure. Then append the new table with production data.

  9. #9
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You really have no business displaying the Primary Keys. Autonumbers/Primary Keys are intended to be used for one purpose and only one purpose, to provide a unique identifier for each record. They should not be used as account numbers, serial numbers, etc. Here's a post I've archived from a gentleman named John Vinson, MVP, explaining how Autonumbers work:

    Quote Originally Posted by John Vinson
    When using Autonumber, do be aware that there will be gaps in the numbering any record that's deleted will leave a gap; hitting <Esc> after starting a record will leave a gap; adding records using an Append query may leave a gap, often a huge one; replicating the database will make your invoice numbers random.

    In short... it's best NOT to use Autonumbers for human consumption, and particularly not for consumption by accountants and auditors. Invoice sequences like 319, 321, 322, 385, 386, 221841246, 1083225152 make such people get very nervous.
    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  10. #10
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    Ok, so I should change my primary key then to just numeric and say no duplicates? This way as they do data entry above the 1.3 million records it will assign the next number inline?

  11. #11
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    I can make it so the number does not display on my listbox. My problem is the fact that rows 1-1.3 milllion all contain data of sometype. Some fields might be null. When I view my listbox of items on the form, it begins at 46 and then goes to like 1001 and then skips again until 5000 and so on through the entire listbox. Yet there is data in 1002, 1003, 1004 etc. It is as if only records that have 100% everything in every column are being displayed. I am not sure how to set it up to say give me it all. I am concerned that it does not pick up those items in the listbox. Yet the table I can see it all. I am posting my database not with 1.3 million records but just an example. What am I missing here?
    Attached Files Attached Files

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Table QualMain would be the one with 1.3 million records now reduced to 60?

    This listbox of interest is on forms frmQualityProgramsUpdate and frmQualityProgramsDataEntry (I would make one form serve both purposes).

    The RowSource of listbox is an SQL with 11 tables joined to QualMain, all with INNER JOIN. INNER JOIN requires related records in ALL tables for any records to show. The listbox has only 2 items listed (QID 46 and 60). Change each to RIGHT JOIN and all 60 records list.
    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.

  13. #13
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    Ah ha. What a dummy I am................I never ever thought of that. I was thinking I could attempt some sort of show me null or not null but now I forgot totally about various joins....Thanks I will try that really quick here.

  14. #14
    cuddles is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    98
    Geeze oh Pete. June7, what would I do without you. You know I have programmed in SAS for like 10yrs and I do inner, outer, left, right, so many joins. But I am so used to just typing all my code myself in the proc sql statement and just got so into that habit. With Access over the last 2 months I have got into this habit of joining with design view. I need to start using the SQL view instead and maybe I would not have so many darn issues!!!!!!

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Access will automatically apply joins as established in Relationships window. Either set the relationships as you would normally want to see them or don't build relationships which will force you to always manually establish the links in the query builder.
    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.

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

Similar Threads

  1. Replies: 10
    Last Post: 06-03-2013, 10:24 AM
  2. Replies: 1
    Last Post: 04-01-2013, 02:18 PM
  3. Replies: 12
    Last Post: 06-08-2012, 02:37 AM
  4. Combo Box not showing the correct Field
    By Atlascycle in forum Reports
    Replies: 61
    Last Post: 03-12-2012, 10:51 AM
  5. Replies: 9
    Last Post: 06-26-2011, 09: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