puressence73
New member
- Local time
- Today, 08:21
- Joined
- Jan 31, 2009
- Messages
- 5
Hello,
I have an Excel spreadsheet which is linked to 2 tables in an Access database. The reason for this is to generate and calculate tax details, which is easier in Excel than Access.
I have a macro in my Access database which closes the only instance of Access and opens Excel.
As soon as excel opens it updates from the database. I then have a form triggered by the spreadsheet.change event so that the user can then load criteria to the form to activiate a series of date related filters. Once this is done a print out of the figures is generated.
This is where I get stuck!!!!
I need to now somehow get back to Access which is causing me some trouble.
Firstly the link from the Access tables to the spreadsheet prevents Excel from re-opening the DB. So as a work around I have put a line in to delete the connected spreadsheets before quiting Excel. I would like a smarter solution if you have any ideas but this does work as a stop gap.
The second problem is that when I re-open Access from the Excel macro, closing Excel in the process, it only remains open for a few seconds before disappearing so basically I end up with everything shut down!!!!!!!
This is the code I am using to
'Path to Access database
LPath = "C:\database project.accdb"
'Open Access and make visible
Set oApp = CreateObject("Access.Application")
oApp.Visible = True
'Open Access database as defined by LPath variable
oApp.OpenCurrentDatabase LPath
oApp.DoCmd.OpenForm "User Input"
With oApp
.DoCmd.RunMacro "Beep"
End With
DateInput.Hide
Application.Quit
End Sub
I would be very gratefull if someone could give me some ideas as I am pulling my hair out trying to get around this.
Regards
M
I have an Excel spreadsheet which is linked to 2 tables in an Access database. The reason for this is to generate and calculate tax details, which is easier in Excel than Access.
I have a macro in my Access database which closes the only instance of Access and opens Excel.
As soon as excel opens it updates from the database. I then have a form triggered by the spreadsheet.change event so that the user can then load criteria to the form to activiate a series of date related filters. Once this is done a print out of the figures is generated.
This is where I get stuck!!!!
I need to now somehow get back to Access which is causing me some trouble.
Firstly the link from the Access tables to the spreadsheet prevents Excel from re-opening the DB. So as a work around I have put a line in to delete the connected spreadsheets before quiting Excel. I would like a smarter solution if you have any ideas but this does work as a stop gap.
The second problem is that when I re-open Access from the Excel macro, closing Excel in the process, it only remains open for a few seconds before disappearing so basically I end up with everything shut down!!!!!!!
This is the code I am using to
'Path to Access database
LPath = "C:\database project.accdb"
'Open Access and make visible
Set oApp = CreateObject("Access.Application")
oApp.Visible = True
'Open Access database as defined by LPath variable
oApp.OpenCurrentDatabase LPath
oApp.DoCmd.OpenForm "User Input"
With oApp
.DoCmd.RunMacro "Beep"
End With
DateInput.Hide
Application.Quit
End Sub
I would be very gratefull if someone could give me some ideas as I am pulling my hair out trying to get around this.
Regards
M

Last edited: