Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using existing msaccess form within Excel

Status
Not open for further replies.

ltworf

Programmer
Mar 14, 2003
10
CA
I'm using office xp. I have a form in my accessDB that changes the dates in my queries. I would like to access this form via Excel. Does any one have any code they can share with me that would help.
 
Dim objAccessApp As Access.Application

Set objAccessApp = GetObject(YourAccessFileNameAndPath)

objAccessApp. etc

objAccessApp.Quit
Set objAccessApp = Nothing

Good LucK!
 
Thx that helped me on my way. So now I have it opening the AccessDB then a macro runs to open the form. Is there no way to just open the form without having to open the AccessDB.Here si what I have in my script:

Sub controlAccess()
Dim objAccess As Object
Set objAccess = CreateObject("Access.Application")

objAccess.OpenCurrentDatabase filepath:= _
"\\WCAB855766\ACCESS\ccos.mdb"
objAccess.Visible = True


'this open the database then runs a macro in access to open the form
myAccess = objAccess.Run("OpenFormInExcel")

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top