Results 1 to 10 of 10
  1. #1
    matt704 is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    49

    Issue with VBA code running on my system

    I got assistance creating a VBA code to help sort my data. For some reason, the code will not run on my computer, but the same code in the same DB will run on other computers. Attached is the sample DB with the attached Code. When I delete data in table "tmpLastDate" and then run the code, nothing goes into the "tmpLastDate" table.

    TestDB1 - Copy (4).zip

  2. #2
    matt704 is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    49
    To add to that, when I run the code without deleting data in the "tmpLastDate" table first, all rows and all fields in the table are replaced with #Deleted.

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Put a breakpoint at the start of your VBA code (click on left grey bar at line you want, will see a red dot meaning code will stop at that line). Then run the code and use F8 to step through the code line by line to see where the issue is.

  4. #4
    matt704 is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    49
    The code is running fine on another system, and still runs on mine, it just doesn't do what it is supposed to do. I tried running through the code, and it runs, just with the incorrect result (i.e., doesn't populate the table).

  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Open the table directly and see if you can manually add a record, maybe something with the link or ODBC connection? Are these SQL or Access tables? Do you have them linked to a BE or is it all in 1 Access database.

  6. #6
    matt704 is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    49
    I think I figured it out. The table "tmpLastDate" has to be closed in access for the module to run.

  7. #7
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Congrats!!

  8. #8
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I think I figured it out. The table "tmpLastDate" has to be closed in access for the module to run.
    I'm thinking not. Which computer you run it on should not be affected by how it runs with the table open in datasheet view. That and the #Deleted comment is a clue that you're not refreshing the table when you run this and the table was already open. To prove this, open the date table, select all rows and delete. Then run the code while that table is still in view. Then use the Refresh All button on the ribbon (version 2007, yours should be similar or if not found, Ctl+F9) and watch what happens.
    Last edited by Micron; 01-24-2017 at 12:17 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    matt704 is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    49
    Yep, refresh all populated all empty cells.

  10. #10
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You have an Excel frame of reference when writing about this . Those are not cells, they're fields and your action isn't really populating them. You're only refreshing the view of the table. Glad we figured it out any way.
    Last edited by Micron; 01-24-2017 at 07:02 PM. Reason: Spelin
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-18-2013, 05:53 PM
  2. Replies: 3
    Last Post: 05-09-2013, 09:17 AM
  3. Replies: 12
    Last Post: 12-11-2012, 01:47 PM
  4. MS Access 2003 running 64 bit system problem
    By stan_the_man21ph in forum Access
    Replies: 3
    Last Post: 09-14-2011, 10:52 PM
  5. Can System Restore correct Form Size issue
    By fordtough in forum Forms
    Replies: 0
    Last Post: 04-12-2011, 02:56 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