Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.
RunPickAccessMacro ("test") Private Sub RunPickAccessMacro(ByVal sMacro As String) Dim oAccess As Access.ApplicationClass Try oAccess = CreateObject("Access.Application") oAccess.Visible = True oAccess.UserControl = True oAccess.AutomationSecurity = 1 'oAccess.OpenCurrentDatabase("\\mwwnas1\mwwnas1f\mis\Projects_Prod\PickTick\pickticket97_test2.mdb;", False, False) oAccess.OpenCurrentDatabase("c:\test.mdb;", False, False) oAccess.DoCmd.RunMacro(sMacro) 'Clean-up: Quit Access without saving changes to the database. oAccess.DoCmd().Quit(Access.AcQuitOption.acQuitSaveNone) System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess) oAccess = Nothing Catch ex As Exception sErrNo = Err.Number.ToString sError = "**Macro" & vbCrLf & Err.Description & " " & "ErrNo: " & sErrNo dispError(sError) End Try End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.