Results 1 to 4 of 4
  1. #1
    SorenIX's Avatar
    SorenIX is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    15

    Auto Open Security Notice

    Hi,



    I made a button to import 2 tables from a selected file, but when the files are open to import the table, it asks if I want to open or not... That security notice thing. It only imports the tables after you click on the open of the two security notices. I attached a zipped picture.

    Is there a way I could make it open automaticly?

    I thought about a sort of macro that would imitate < LeftArrow, Enter, LeftArrow, Enter >, but I don't know how and if it's possible.

    EDIT :

    I know that for Access 2007 the extensions are *.accdb and *.accde. I just want to know what they are for Access 2010.
    Last edited by SorenIX; 06-24-2011 at 01:33 AM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Post the code for the import procedure.
    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
    SorenIX's Avatar
    SorenIX is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    15
    This is the import code :

    Code:
    Private Sub Yes_Click()
    
        Me.tbHidden.SetFocus
        
        DoCmd.RunSQL ("DROP TABLE AnimeTab")
        DoCmd.RunSQL ("DROP TABLE TypeTab")
        DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "AnimeTab", "AnimeTab", False
        DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "TypeTab", "TypeTab", False
        DoCmd.Close acForm, "ImportForm", acSaveNo
        DoCmd.OpenForm "MenuForm", acNormal
        
    End Sub
    Right now I'm trying to make sure that if the table doesn't exist in the database, it won't stop the process... but I can't get it to work... I tried this :

    Code:
    Private Sub Yes_Click()
    
        Me.tbHidden.SetFocus
        
        If AnimeTabTableExists Then
        DoCmd.RunSQL ("DROP TABLE AnimeTab")
        
        If TypeTabTableExists Then
        DoCmd.RunSQL ("DROP TABLE TypeTab")
        
        Else
        DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "AnimeTab", "AnimeTab", False
        DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "TypeTab", "TypeTab", False
        DoCmd.Close acForm, "ImportForm", acSaveNo
        DoCmd.OpenForm "MenuForm", acNormal
        
    End If
    End If
    End Sub
    But nothing happens... no error... no import... just nothing. I'm not sure about the If AnimeTabTableExists Then step.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Here is thread about how to check if table exists and has alternate approach of just handling the error if table does exist. http://www.tek-tips.com/viewthread.cfm?qid=933401

    I don't know how to get around the security warning other than to reduce security settings in the Access app. I doubt DoCmd.SetWarnings = False will suppress security warnings.

    Step debug, follow the code as it executes, discover where it deviates from expected behavior.
    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.

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

Similar Threads

  1. Security Help
    By Cheshire101 in forum Security
    Replies: 4
    Last Post: 03-30-2011, 02:43 PM
  2. Replies: 2
    Last Post: 02-26-2010, 08:14 AM
  3. How to create warning notice
    By bluepowa in forum Programming
    Replies: 3
    Last Post: 09-29-2009, 03:15 AM
  4. Security..Is there another way?
    By marianne in forum Security
    Replies: 0
    Last Post: 07-19-2009, 07:18 PM
  5. Security Warning
    By mojo53777 in forum Security
    Replies: 0
    Last Post: 11-16-2007, 06:23 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