AT_Start.bas 874 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Option Compare Database
  2. Option Explicit
  3. ' ** AT_Start Module **
  4. ' on 2017-02-28,
  5. ' @author: Olivier Massot
  6. ' V 1.0
  7. ' > Use these functions while starting your application
  8. ' You can call them in a macro named 'Autoexec' (it will then launch at start),
  9. ' or at the Open or Load event of your main form
  10. Public Sub LoadMenu(ByVal fname As String)
  11. ' Requires AT_VersionManager, AT_Mail, AT_Users
  12. ' display options
  13. DoCmd.RunCommand acCmdAppRestore
  14. DoCmd.RunCommand acCmdAppMaximize
  15. '*** users related options
  16. ' check if exist, or creates
  17. '*** connexion
  18. ' check current connexion, warns if not default
  19. '*** check version (only if default connexion)
  20. If Not up_to_date() Then
  21. Call send_update_mail
  22. If Not is_admin() Then
  23. Application.Quit
  24. End If
  25. End If
  26. End Sub