Results 1 to 12 of 12
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Some sort of table corruption?

    I have an split DB app that seems to have a corrupted table in the backend. The problem is the visibility of one of its fields when either the table or query of the table is opened directly, but not an issue when referenced as RecordSource for a form, report or DAO Recordset, there are NO fields "Hidden". One of the app's primary forms has the query of the table as its RecordSource and the data for the troublesome field displays as always:
    Query: Click image for larger version. 

Name:	000.jpg 
Views:	24 
Size:	9.6 KB 
ID:	46387 Form:Click image for larger version. 

Name:	001.jpg 
Views:	24 
Size:	19.9 KB 
ID:	46388 The form, in design view, clearly reveals that the text box is bound to the troublesome table field "EmailWk".



    I put together a general module to audit the table content for the troublesome field:
    Code:
    Option Compare Database
    Option Explicit
    Private Sub AuditQAsilomar()
    Dim rs As DAO.Recordset
    
    
    Set rs = DBEngine(0)(0).OpenRecordset("QAsilomar")
    
    
    rs.MoveLast
    
    
    If rs.RecordCount > 0 Then
        rs.MoveFirst
            While Not rs.EOF
                If Not IsNull(rs!EmailWk) Then Debug.Print rs!EmailWk
            rs.MoveNext
            Wend
    End If
    
    
    rs.Close
    Set rs = Nothing
    
    
    End Sub
    The above audit displayed a multitude of email addresses in the IM that are contained in the DB.

    I've tried new queries, copying the backend mdb, copying structure only followed by an append, simple copying of the table, even moving the position of the "EmailWk" field in the table's design view.

    Once again, I checked the open table view to insure the field IS NOT HIDDEN.

    What else can I try?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    this works for me:

    try
    if not IsNull(rs.fields("EmailWk").value ) then debug.print rs.fields("EmailWk").value

    otherwise, it may be your recset.

    dim db
    dim rs

    set db = currentdb
    Set rs = db.OpenRecordset("QAsilomar")

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Sorry, I don't understand your reply. As I stated in the OP, my audit code found and printed in the IM all the instances of the non-null "EmsilWk" fields in the query. Does your method do something different? Anyway, I get the same result with your statement:
    Code:
    if not IsNull(rs.fields("EmailWk").value ) then debug.print rs.fields("EmailWk").value

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Based on multiple failures of new queries based on the troublesome table, I've come to the conclusion that I indeed have a seriously corrupted table. That being said, There's quite a bit of infomation in the table, 300 records at 27 fields each.

    Seeing as how the code shown in the OP seems to find the fields of interest okay, I can envision a new table with identical structure together with two DAO Recordsets where I move each records worth of fields one at a time to the new table. Is there a way to accomplish the move using some code together with references to the Fields Collection, or am I faced with some grotesque looking code that moves each of the 27 fields one at a time?

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    What else can I try?
    A C/R?

    You know that any kind of Move with no records will raise an error, yes? So a MoveLast before checking that there are records isn't the way to do it.
    Besides a c/r, could also import the table into a new db and check its behavior in datasheet view. If OK, might want to rename table in current db as tblMyTableOLD and then import from the test db and see if OK. If so, delete OLD.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    import the table into a new db and check its behavior in datasheet view
    Tried that in addition to simple c/r but that didn't work either, i.e., field continues to hide from any kind of view.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Then I'm stumped for now. Perhaps post the test db with the table for other sets of eyes?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Can you believe this! I have no idea how the squeeze occurred, but:

    Paul spotted why the field doesn't display:
    Click image for larger version. 

Name:	002.jpg 
Views:	17 
Size:	21.4 KB 
ID:	46391

    So the display issue wasn't anything other than a smoke-screen to the real problem, which has to do with queries based on "the table" that when used as RecordSource to a report fails to return the field values. Another OP if I can't find that, as it's a different issue.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Sometimes I/we overlook the obvious, especially when you can't actually see it. So this is your first experience with setting a field width to zero, I take it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    So this is your first experience with setting a field width to zero, I take it.
    Yes, as the saying goes, "Down a rabbit hole" never to return.

    It's professionally embarrassing when these kind of issues "Rear its ugly head".

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Just do what I do - put it down to old age, regardless of what the number is. Better excuse than booze or drugs, yes?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    put it down to old age
    Well, that is the truth of the matter........... SIGH!

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

Similar Threads

  1. Sort of transposing a table ????
    By ksor in forum Programming
    Replies: 3
    Last Post: 01-11-2018, 03:17 PM
  2. VBA Module Corruption
    By Jrbeene86 in forum Modules
    Replies: 4
    Last Post: 07-30-2012, 01:28 PM
  3. Table lookup, sort of
    By avarusbrightfyre in forum Programming
    Replies: 1
    Last Post: 08-30-2011, 02:20 PM
  4. Corruption nightmare
    By Remster in forum Access
    Replies: 4
    Last Post: 03-25-2011, 06:40 AM
  5. Replies: 4
    Last Post: 06-10-2010, 07:51 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