Solved

new to Access 2010:  test via vba the Application version

Posted on 2013-05-28
4
767 Views
Last Modified: 2013-05-29
Hi EE,

a) i just learned from EE expert: fyed that one can test the version of Access that the
pc is running like this:

If Application.Version < 12 Then

b) Many years ago, a colleague who i lost touch with taught me a technique of toggling
between running a db in test mode, or prod mode

by having 2 transparent cmd buttons on the main menu form that are executed with
an alt command:

alt+t - executes the transparent test button
alt+p - executes the transparent prod button

both buttons set an application property called developmentmode to either
    development - test   or
    deployment   - prod

so my questions are:

a)  in the code below which application properties are not relevant for 2010

b) should i test the application version, and execute this entire code if vers less than 12
     b1) if yes, if i ever wanted to execute under access 2003, i would have to convert
                the accdb back to mdb
     b2) if i have to convert the accdb back to mdb, i would have to change the vba
           references back to what the mdb expects

the test mdb is uploaded below
    form has the 2 command buttons showing (that normally would be transparent)
    form's open event test whether to show the db on thenext opening of the db
                in test  or prod mode

tx for you help, sandra


If (enMode = enSetupUpOption.Delivery) Then
   SetApplicationProperty "StartupShowDBWindow", dbBoolean, False
   SetApplicationProperty "StartupShowStatusBar", dbBoolean, False
   SetApplicationProperty "AllowFullMenus", dbBoolean, False
   SetApplicationProperty "AllowShortcutMenus", dbBoolean, False
   SetApplicationProperty "AllowBuiltInToolbars", dbBoolean, False
   SetApplicationProperty "AllowToolbarChanges", dbBoolean, False
   SetApplicationProperty "AllowBreakIntoCode", dbBoolean, True
   SetApplicationProperty "AllowSpecialKeys", dbBoolean, False
   SetApplicationProperty "DevelopmentMode", dbBoolean, False
   
   If Len(strStartUpForm) > 0 Then
      SetApplicationProperty "StartUpForm", dbText, strStartUpForm
   End If
 
   Application.SetOption "Show Status Bar", False
   ' CommandBars.Item("Menu Bar").Enabled = False
   
   Call DisplayNavPane(False)
   Call DisplayRibbon(False)
   
   
ElseIf (enMode = enSetupUpOption.Development) Then
   SetApplicationProperty "StartupShowDBWindow", dbBoolean, True
   SetApplicationProperty "StartupShowStatusBar", dbBoolean, True
   SetApplicationProperty "AllowFullMenus", dbBoolean, True
   SetApplicationProperty "AllowShortcutMenus", dbBoolean, True
   SetApplicationProperty "AllowBuiltInToolbars", dbBoolean, True
   SetApplicationProperty "AllowToolbarChanges", dbBoolean, True
   SetApplicationProperty "AllowBreakIntoCode", dbBoolean, True
   SetApplicationProperty "AllowSpecialKeys", dbBoolean, True
   SetApplicationProperty "DevelopmentMode", dbBoolean, True
   SetApplicationProperty "StartUpForm", dbText, "(none)"
   
   Application.SetOption "Show Status Bar", True
   ' CommandBars.Item("Menu Bar").Enabled = True
   
   Call DisplayNavPane(True)
   Call DisplayRibbon(True)
   
   
Else

   MsgBox "PROGRAM ERROR@Invalid option passed to procedure SetStartupOptions.@Fix and retry...", vbCritical, "SYSTEM ERROR"

End If
2013-05-24-ARG-00-MainSystem-fro.accdb
0
Comment
Question by:mytfein
  • 2
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39204451
<<If Application.Version < 12 Then>>

 Yes.  Also there is a syscmd call and some complier constants you can use.

<<a)  in the code below which application properties are not relevant for 2010>>

 All are valid.  I don't see any off-hand that would not run.

  Before I go further (and maybe it's time for another cup of coffee), but it's not clear to me where your heading and why it matters if it's a accdb or MDB.

  All the properties are the same except for handling the ribbon.

Jim.
0
 

Author Comment

by:mytfein
ID: 39204687
Hi Jim,

tx for writing...

IT installed 2 pcs connected to one monitor.

i want the ability to convert an accdb back to mdb

right now i have a2010 but my users have a2003

i have many mdbs that need to be converted to accdb

let's say it takes a month to convert the mdbs, and during this time,
user asks for modifications for an existing mdb. i do not want to modify the
mdb and the accdb.

so would like to:
    - convert the mdbs to accdb for my pc
    - if an accdb needs a modification, can change and if code
            is acceptable under mdb world, would convert it back to mdb
                    to run on users' pc
              (this way i do not have to modify the accdb version
                         and the mdb version

               so that's why i asked if the mdb vba code will run in accdb mode.
                      or condition the vba code with the application vers bec
                            maybe there is code that is particular to each version.


- when converting accdb to mdb
                                   or
                                mdb to accdb

  does one have to modify the Toos/references appropriately

   if yes, then simply doing a convert is not enough,
             after the convert one has to modify the references.
0
 
LVL 57
ID: 39205341
Sandra,

<<i want the ability to convert an accdb back to mdb >>

 I would strongly suggest not doing this, especially with A2010, which has had a number of issues, even ones just going back to A2007 and sticking with accdb format.

 For multi-version development, the rule of thumb is always to develop in the lowest version, then move to a higher version.

 Going backwards is almost always an issue.

<<    - convert the mdbs to accdb for my pc
    - if an accdb needs a modification, can change and if code
            is acceptable under mdb world, would convert it back to mdb
                    to run on users' pc
              (this way i do not have to modify the accdb version
                         and the mdb version
>>

 Can't say this emphatically enough; forget about doing this.  Your going to have problems.

<<- when converting accdb to mdb
                                   or
                                mdb to accdb

  does one have to modify the Toos/references appropriately
>>

  Moving from an earlier version to latter, not always.  References will automatically fix up for the most part (the main ones that relate to office).  Others might need to be adjusted depending on what your using.

  Moving backwards, no never are references adjusted automatically.  You'd need to manually modify the references.

Jim.
0
 

Author Comment

by:mytfein
ID: 39205373
tx so much Jim!  s
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question