Page 1 of 3 123 LastLast
Results 1 to 15 of 34
  1. #1
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48

    Property not found error

    This might not be the right thread. Please direct me to the correct area if that's the case.

    I'm upgrading an Access 97 application to Access 2016. By and large it's going well: all forms and reports seem to have come over with little trouble, although I had to manually recreate the 30-ish tables necessary.



    My question comes from the execution of a "Welcome" form that launches when the database is invoked, and begins to load the form accordingly, but somewhere between the completion of opening the form and invoking the timer, I get a general Access error box that say "Property Not Found". I've coded break points (simple message boxes that say where they are in the code) and the message always come up somewhere between the execution of the form opening script ("On Open" property) and the timer script ("On Timer" property).

    I'm wondering if there is another way to step through the execution of this form to discover where the error is coming from. I don't mean to step through any VB code, I mean to query the DB engine to find out what's generating that error (something like that, anyway).

    Any suggestions?

    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    the 1st line in the routine can be : ON ERROR RESUME NEXT

    it will not show errors.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,941
    Did the old DB have any custom properties?
    Put a break point on the first line of executable code and walk through it line by line with F8
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48
    I'd like to do that, but I'd really like to know where this error is coming from. It may be nothing, but it might be something.

    Thanks for looking.

  5. #5
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48
    The old DB h ad/has tons of custom stuff: 30+ tables, at least as many forms, VBA code (is that correct? VBA code?...regardless), and so many controls with properties. I need a way to narrow it down some...actually, a lot.

    Thanks for looking.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If there is an "On Error GoTo..." line, temporarily comment it out and run the code. You may get a debug option that will tell you the specific spot that causes the error. If I had to guess, there's code looping the controls on the form and referring to a property that doesn't exist for all controls (like the Value property and the current control is a label). In that event, you could limit the types of controls tested.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,941
    Run this code on each db and compare the output.
    It might be obvious if you see something you recognise, like a copyright notice mentioned here
    http://allenbrowne.com/ser-09.html
    Code:
    Sub ListDBProperties()
    Dim db As DAO.Database
    Dim P As Property
    
    Set db = CurrentDb()
    For Each P In db.Properties
            Debug.Print P.Name
    Next
    Set db = Nothing
    
    End Sub
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Some properties are not created until you utilise them during form creation, if you have been creating new forms and copying across ‘old’ code, it me be trying to reference such a property.

    And as access has matured it has become less tolerant of poorly written code

    Ensure you have option explicit at the top of every module just below option compare database and then compile your code

    Otherwise temporarily disable your error checking allowing the code to stop on the offending line.

  9. #9
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48
    Would I do this in an immediate window or as a separate routine that executes at runtime? I'm uncertain on where this goes or how to invoke it.

    Thanks

  10. #10
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48
    Where exactly would I put this code, in an immediate window or save it as a separate routine somewhere in all the code modules? I'm uncertain where this goes or how to invoke it...I'm also not the most experienced at VBA, but I can at least recognize it

    Thanks

  11. #11
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48
    Posts number 9 and 10 were supposed to be a reply to post number 7.

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,941
    Add a new module ModTest or whatever you want to call it.
    Copy and paste into there.
    Click into the code and press F5, then look in the immediate window for the results.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  13. #13
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Error 3270 (property not found) occurs if you try to set the value of a property which doesn't exist.
    I would strongly recommend you don't just use On Error Resume Next in your procedures (as suggested in post #2) as it will effectively suppress all errors without you being aware of them.

    A safer alternative is to handle that specific error as part of your error handling routines. For example:

    Code:
    Public Sub UpdateLinkedTables()
    
    On Error GoTo Err_Handler
    
    ...Your code goes here...
    
    Exit_Handler:
        Exit Sub
    
    
    Err_Handler:
        If Err.Number = 3270 Then 'property not found
            Resume Next
        Else
            MsgBox "Error " & Err.Number & " in UpdateLinkedTables routine :" & vbCrLf & "  - " & Err.description
            Resume Exit_Handler
        End If
    
    
    End Sub
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #14
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    The first things I would do are those suggested by Ajax, Option explicit and error handling.
    What code runs in your open event and timer events?
    Try commenting out code to see where the error may be.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  15. #15
    Monty51 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    48
    Actually there are a number of those lines (I believe almost every single procedure has one, come to think of it), and I'll give that a whirl.

    Thanks!

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

Similar Threads

  1. Replies: 1
    Last Post: 08-04-2020, 06:58 AM
  2. Item not found in this collection .Fields(x) property
    By ironfelix717 in forum Programming
    Replies: 2
    Last Post: 05-19-2019, 10:53 PM
  3. Table suddenly says "Property Not Found"
    By templeowls in forum Access
    Replies: 1
    Last Post: 05-03-2019, 08:45 AM
  4. Replies: 1
    Last Post: 01-13-2019, 01:53 PM
  5. Replies: 7
    Last Post: 06-08-2012, 09:55 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