Question Toolbar Hide - 2003 and 2010

KSReynolds

Registered User.
Local time
Today, 16:14
Joined
Jul 24, 2013
Messages
27
I have a database that is being run on both Access 2003 machines and Access 2007 machines. What I want to do his hide the toolbar on both versions in my on load event of my splash form. Now, I know the one for Access 2003 is
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
and the one for Access 2007 is
DoCmd.ShowToolbar "Ribbon", acToolbarNo

But how do I get Access to evaluate which version is running to do an if statement to execute.

I tried:
If version = "14.0" then
DoCmd.ShowToolbar "Ribbon", acToolbarNo
end if

Will that work?
 
If CurrentDb.Version = 12 Then
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End If

I think Access 2010 is a 12?
 
Access 2010 is 14.. If I am correct 2007 is 12..

EDIT: I am correct :D just did a Quick search to Validate..
 
Last edited:
Now this is truly odd. I am running Access 2003, but my database is saved in the 2000 format. When I do:
? CurrentDb.Version
in the immediate window, I get a value of 4. According to this chart, it should not be a 4.
 
Well that truly is amusing.. I get the same result if I convert my file to an MDB to 2007 version.. Well I think that is where I can safely say "I don't know the answer".. :o

I am sure someone would be able to provide an explanation for the weird version number.. But if I try the same with Application it seems to give a correct answer.. running A2010
Code:
In an MDB file A2007 version,
? Application.Version
14.0
? CurrentDB.Version
4.0

In an ACCDB file A2010 version, 
? Application.Version
14.0
? CurrentDB.Version
14.0
 
But my users are going to be running the application as an .mdb file. Now they told me they are bringing on Access 2013 machines to the mix. What do you get running an .mdb on Windows 2010?
 
Okay I think I was not clear in my findings.. Application.Version uses the version number of installed version.. So if your computer has A2010 installed then the Version number given is 14, if it is 2007 I think it will give out 12 so on and so forth.. However I am unable to test it..

Makes sense? Use Application.Version..
 

Users who are viewing this thread

Back
Top Bottom