Gday, I have a report in access that takes its data from a query. That query in turn has criteria which are passed to it from a form presented to the user. This form takes name, and a start and end date. That is all.
What i'd like to do is from excel, open the report at the name specified by the user (ie, clicking the name shown in a cell). That is, instead of having to select the name from a combo box on the form, then putting in the 2 dates, have excel automatically pass that information to access and simply present the user with the finished report.
Here is the code i'm using to open the report;
Thanks for the help.
What i'd like to do is from excel, open the report at the name specified by the user (ie, clicking the name shown in a cell). That is, instead of having to select the name from a combo box on the form, then putting in the 2 dates, have excel automatically pass that information to access and simply present the user with the finished report.
Here is the code i'm using to open the report;
Code:
Sub Report()
Dim LPath As String
Dim LCategoryID As String
'Path to Access database
LPath = "\\aa-server\AerospaceSMS\AerospaceSMS.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
'Open form called Categories filtering by CategoryID
LCategoryID = Range("A19").Value
oApp.DoCmd.OpenForm "studentreport"
'oApp.SearchName.Value = "Your new value"
End Sub
Thanks for the help.