Launching Access from a userform

G

GWizz

Hi everyone, could do with a little help if you can !

Have a Word UserForm with 2 command buttons on it.

Button one should take me back to an Access Enquiry form closing any other
open forms (i have a shortcut key for that if need be) the other just
re-activates access and leaves everything as is. Clicking either button
should obviosuly check to see if access is running and launch it if not.
Apologies for the long winded description and i'll post back if i manage to
resolve this.

Regards


--
 
G

GWizz

Ok so i can now switch to an already running access using

If Tasks.Exists("Taylor & Emmet") = True Then
With Tasks("Taylor & Emmet")
.Activate
.WindowState = wdWindowStateMaximize
End With
Else
'Access not open so create the access object and open

End if

Guess my next question is how to create the object :)

--
 
G

GWizz

Ok here's the code i have so far, but there must be a better way of making
sure the newly opened application 'Access' is maximised.

Public Function Access_Available(blReset As Boolean)

If Tasks.Exists("Taylor & Emmet") = True Then
With Tasks("Taylor & Emmet")
.Activate
.WindowState = wdWindowStateMaximize
End With
If blReset Then
SendKeys "^+r"
End If
Else
'Access not open so open it and show the Client Enquiry form
Dim objAccess As Object
Dim objApp As Object
Set objAccess = CreateObject("Access.Application")
Set objApp = GetObject("c:\Clients Front End\NewClientRecords.mdb")
If Tasks.Exists("Taylor & Emmet") = True Then
With Tasks("Taylor & Emmet")
.WindowState = wdWindowStateMaximise
End With
End If
End If

End Function

Regards


--
 

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