Opening a MS 2010 Access form from an Excel :
This code had no problem executing correctly in MS Office 2010. This code is not opening the form in Excel 2013. Here's the code:
[/code]
Sub ACCESSOPENFORM()
Dim ac As Object
Dim str As String
On Error Resume Next
Set ac = GetObject(, "Access.Application")
If ac Is Nothing Then
Set ac = GetObject("", "Access.Application")
ac.OpenCurrentDatabase "C:\Users\Charles\Desktop\PDOX DB.accdb"
ac.docmd.OpenForm "FORMVIEW"
ac.UserControl = True
Set ac = Nothing
End If
AppActivate "Microsoft Access"
ac.OpenCurrentDatabase "C:\Users\Charles\Desktop\PDOX DB.accdb"
ac.docmd.OpenForm "FORMVIEW"
[/code]
Comments:
In MS Access 2013 which I now have and like much better, Access opens and minimizes on the taskbar, but for some reason, the form FORMVIEW doesn't open and display over an Excel worksheet like it did very smoothly and flawlessly in Excel 2010. Why? Been trying to figure this out all day.
Need to get this working.
Thanks for anyone's help out there.
cr
This code had no problem executing correctly in MS Office 2010. This code is not opening the form in Excel 2013. Here's the code:
[/code]
Sub ACCESSOPENFORM()
Dim ac As Object
Dim str As String
On Error Resume Next
Set ac = GetObject(, "Access.Application")
If ac Is Nothing Then
Set ac = GetObject("", "Access.Application")
ac.OpenCurrentDatabase "C:\Users\Charles\Desktop\PDOX DB.accdb"
ac.docmd.OpenForm "FORMVIEW"
ac.UserControl = True
Set ac = Nothing
End If
AppActivate "Microsoft Access"
ac.OpenCurrentDatabase "C:\Users\Charles\Desktop\PDOX DB.accdb"
ac.docmd.OpenForm "FORMVIEW"
[/code]
Comments:
In MS Access 2013 which I now have and like much better, Access opens and minimizes on the taskbar, but for some reason, the form FORMVIEW doesn't open and display over an Excel worksheet like it did very smoothly and flawlessly in Excel 2010. Why? Been trying to figure this out all day.
Need to get this working.
Thanks for anyone's help out there.
cr