Solved

new to Access 2010:  test via vba the Application version

Posted on 2013-05-28
4
732 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
Comment Utility
<<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
Comment Utility
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

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
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
Comment Utility
tx so much Jim!  s
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

763 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now