Can anyone help with the latest Tonys AutoFE?

S

SimeonD

I'm a bit confused. Why does the version of the ADP or mdb matter?
Is it not just the version of office?
There is come code I use below, which determines the version of Access. Its
VB 2005 though.
Not sure if its any use, but its along the lines of what Doug was saying.

Its from a project I had last year, to open an Access ADP from a third party
app. The idea was to open frmClient in Access, looking at a the same client
that was on screen in the third party app.
As far as I remember, my main problems were: (1) Determing if only access
runtime was available. (2) Finding out if the Access app was already open.


'********************************************************
' Get the nice style of the Access version name.
Public Function GetAccessVersionNiceName() As String

Try
Select Case GetAccessVersionNumber()
Case 8
Return "Access 97"
Case 9
Return "Access 2000"
Case 10
Return "Access XP"
Case 11
Return "Access 2003"
Case 12
Return "Access 2007"
Case Else
Return "unknown"
End Select
Catch ex As Exception
Return "unknown"
End Try

End Function


' Determine the Access version by creating an
' Access.Application object and looking at
' its Version property.
Private Function GetAccessVersionName() As String
Dim obj As Object = CreateObject("Access.Application")
Dim result As String = "Access.Application." & _
obj.Version
obj.Quit()
Return result
End Function

' Get the Access version number from the name.
Private Function GetAccessVersionNumber() As Integer
Dim txt As String = GetAccessVersionName()
Dim pos2 As Integer = txt.LastIndexOf(".")
Dim pos1 As Integer = txt.LastIndexOf(".", pos2 - 1)
txt = txt.Substring(pos1 + 1, pos2 - pos1 - 1)
Return CInt(txt)
End Function
 
T

Tony Toews [MVP]

SimeonD said:
I'm a bit confused. Why does the version of the ADP or mdb matter?
Is it not just the version of office?

I look at the version of the MDB to determine which version of Access
which is installed on the system to start up. Now granted it's
unlikely too many people will have multiple versions of Access but
that's how I set it up a while back.

In hindsight I should've figured out a means of getting around this
but there haven't been too many complaints.

There is come code I use below, which determines the version of Access. Its
VB 2005 though.
Not sure if its any use, but its along the lines of what Doug was saying.

Its from a project I had last year, to open an Access ADP from a third party
app. The idea was to open frmClient in Access, looking at a the same client
that was on screen in the third party app.
As far as I remember, my main problems were: (1) Determing if only access
runtime was available. (2) Finding out if the Access app was already open.

I want to use a method that does not require Access to execute until
it's required to run the MDB/ADP.

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top