?
Solved

new to Access 2010:  test via vba the Application version

Posted on 2013-05-28
4
Medium Priority
?
784 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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 58
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

765 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