Results 1 to 2 of 2
  1. #1
    wakerider05 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    2

    Lock Database with multiple versions

    Hi,

    I am trying to lock down my database on form load.

    I currently
    have code that locks down 2007-2010 but if a user uses 2003, they get an
    error.

    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.ShowToolbar "Menu
    Bar", acToolbarNo
    DoCmd.RunCommand
    acCmdWindowHide
    Application.CommandBars("Menu bar").Enabled = False
    Dim i
    As Integer

    For i = 1 To CommandBars.Count


    CommandBars(i).Enabled =
    False
    Next i

    Can you guys help what code I can use that locks either
    version down. Thankyou!

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Access.Version or SysCmd(acSysCmdAccessVer) will return the version number, i.e.

    8 = Access 97
    9 = Access 2000
    10 = Access 2002/XP
    11 = Access 2003

    Access.Version only works in Access2000+, so SysCmd(acSysCmdAccessVer) is better.


    You could have a variable ("AccVer") to get the version

    Maybe: (Air code)
    Code:
    Dim AccVer as Integer
    
    AccVer = SysCmd(acSysCmdAccessVer)
    
       If AccVer <= 11 then
          'Toolbar stuff
       Else
          ' Ribbon stuff
       End If
    
    or   (I prefer the Select Case  construct)
    
       Select Case AccVer
    
          Case Is <= 11
           'Toolbar stuff
    
          Case Is >= 12
           ' Ribbon stuff
    
         Case Else
    
       End Select

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

Similar Threads

  1. The database could not lock table...
    By Dleader in forum Forms
    Replies: 1
    Last Post: 02-13-2013, 09:45 AM
  2. Replies: 2
    Last Post: 01-28-2013, 04:42 PM
  3. Replies: 3
    Last Post: 06-07-2012, 02:34 PM
  4. Replies: 11
    Last Post: 02-11-2011, 05:07 AM
  5. Multiple versions of Access and Windows 7
    By tgavin in forum Access
    Replies: 3
    Last Post: 10-27-2010, 04:10 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