Results 1 to 5 of 5
  1. #1
    kpalar is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2014
    Posts
    9

    Add command not working after reopening the form


    Dear All,

    I have created a unbound form with command button to add record using VBA code. It works as long as I do not close the Database. Once close it and reopen it doesn't work. Please advise.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Might help to see the code.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    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
    Aside from the inadvisability of using Unbound Forms for data entry, in Access, when code runs after written, but doesn’t run after Access is closed then re-opened, in 2007 or later, the folder Access file resides in needs to be declared as 'Trusted.'

    To "Trust" your folder, click:

    • Office Button (top left)
    • Access Options (bottom of dialog)
    • Trust Center (left)
    • Trust Center Settings (button)
    • Trusted Locations (left)
    • Add new location (button)

    Linq ;0)>

  4. #4
    kpalar is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2014
    Posts
    9

    Thumbs up

    Quote Originally Posted by Missinglinq View Post
    Aside from the inadvisability of using Unbound Forms for data entry, in Access, when code runs after written, but doesn’t run after Access is closed then re-opened, in 2007 or later, the folder Access file resides in needs to be declared as 'Trusted.'

    To "Trust" your folder, click:

    • Office Button (top left)
    • Access Options (bottom of dialog)
    • Trust Center (left)
    • Trust Center Settings (button)
    • Trusted Locations (left)
    • Add new location (button)

    Linq ;0)>
    Thank you very much. I works now

  5. #5
    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
    Glad we could help!

    Linq ;0)>

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

Similar Threads

  1. IIf command not working
    By Lifendason in forum Reports
    Replies: 5
    Last Post: 02-10-2014, 03:03 PM
  2. Access Form Requery (F5 on keyboard or reopening) handler?
    By superfury in forum Code Repository
    Replies: 0
    Last Post: 08-23-2013, 03:17 AM
  3. Command Buttons Stopped Working on Form
    By genest11 in forum Reports
    Replies: 12
    Last Post: 02-06-2013, 06:59 AM
  4. Replies: 3
    Last Post: 06-02-2011, 07:40 AM
  5. Filter command not working for subform
    By yes sir in forum Access
    Replies: 15
    Last Post: 10-15-2010, 10:06 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