Results 1 to 4 of 4
  1. #1
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94

    BUT I can not get the window with the "BackupOnOpen" code to close.

    I have the following "onClick" event

    Code:
    Private Sub NewBU_Click()
    
    
    If MsgBox("Do you want to BackUP ???", vbYesNo, "BACKUP???") = vbYes Then
     DoCmd.OpenModule "Backupdb", BackupOnOpen()
    
    'DoCmd.Close acModule,
    'DoCmd.Close acModule, BackupOnOpen()
    'DoCmd.Close acModule, BackupDB
     'DoCmd.Close acModule, "Backupdb", BackupOnOpen()
     
    Else
    End If
    
    
    End Sub
    The backup works well, BUT I can not get the window with the "BackupOnOpen" module (?) code to close. You can see the DoCmd that I have tried.

  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
    I've never opened a module. Try just:

    Code:
    If MsgBox("Do you want to BackUP ???", vbYesNo, "BACKUP???") = vbYes Then
      BackupOnOpen()
    End If
    Edit: It may not want the parentheses
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94
    [code]
    If MsgBox("Do you want to BackUP ???", vbYesNo, "BACKUP???") = vbYes Then
    BackupOnOpen


    End If
    [\code]

    Works. Thanks

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

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

Similar Threads

  1. Replies: 5
    Last Post: 04-08-2021, 09:15 AM
  2. Replies: 4
    Last Post: 11-14-2019, 11:30 AM
  3. Replies: 2
    Last Post: 12-23-2015, 09:32 PM
  4. Replies: 18
    Last Post: 11-04-2015, 02:13 PM
  5. Replies: 0
    Last Post: 01-11-2012, 12:34 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