K
keyur
hi
i have an access form that's linked to an excel worksheet.
this worksheet has a macro which opens the access form.
but with the same macro i want to close the excel workbook
once the access file is opened. with this code the access
form remains open as long as excel file is open.
can anyone help me with what should i add to this? or is
this even possible?
thanks
this is only the last part of the code
ActiveWorkbook.Save
' Initialize string to database path.
Const strConPathToSamples = "G:\Maintenance\CMMS\"
strDB = strConPathToSamples & "Stock Cards-35.mdb"
' Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strConPathToSamples
appAccess.Visible = True
appAccess.WindowState = ppWindowMaximized
' Open Orders form.
appAccess.DoCmd.OpenForm "Stock Cards"
ActiveWorkbook.Close
i have an access form that's linked to an excel worksheet.
this worksheet has a macro which opens the access form.
but with the same macro i want to close the excel workbook
once the access file is opened. with this code the access
form remains open as long as excel file is open.
can anyone help me with what should i add to this? or is
this even possible?
thanks
this is only the last part of the code
ActiveWorkbook.Save
' Initialize string to database path.
Const strConPathToSamples = "G:\Maintenance\CMMS\"
strDB = strConPathToSamples & "Stock Cards-35.mdb"
' Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strConPathToSamples
appAccess.Visible = True
appAccess.WindowState = ppWindowMaximized
' Open Orders form.
appAccess.DoCmd.OpenForm "Stock Cards"
ActiveWorkbook.Close