T
teddysnips
My clients have asked me to maintain a database that was developed in-
house. It's pretty good, considering the developer isn't a
"programmer".
The first thing they want me to do is to split it into a Front End/
Back End, which is very sensible. However, there are a number of ad
hoc queries that are required to be available to all users, which can
be edited, deleted or created "on the fly". The most sensible
solution would seem to be to store these in the Back End database, and
to get access to them thus:
Dim dbNew As DAO.Database
Dim qdfExisting As DAO.QueryDef
‘ Open the back end database
Set dbNew = DAO.Workspaces(0).OpenDatabase("C:\Projects\MyProject
\TestBackEnd.mdb")
‘ Open the query on the back end database
Set qdfExisting = dbNew.QueryDefs("qryGetCustomer")
In the existing code there is a function to edit these ad hoc queries
using the DoCmd.OpenQuery function.
DoCmd.OpenQuery "qryGetCustomer", acViewDesign
This works fine in the unsplit version. However, I can't seem to work
out how to pass a query on the remote database into this function.
Not unsurprisingly this doesn't work:
DoCmd.OpenQuery dbNew.QueryDefs("qryGetCustomer"), acViewDesign
Has anyone any ideas on how to solve this?
Thanks
Edward
house. It's pretty good, considering the developer isn't a
"programmer".
The first thing they want me to do is to split it into a Front End/
Back End, which is very sensible. However, there are a number of ad
hoc queries that are required to be available to all users, which can
be edited, deleted or created "on the fly". The most sensible
solution would seem to be to store these in the Back End database, and
to get access to them thus:
Dim dbNew As DAO.Database
Dim qdfExisting As DAO.QueryDef
‘ Open the back end database
Set dbNew = DAO.Workspaces(0).OpenDatabase("C:\Projects\MyProject
\TestBackEnd.mdb")
‘ Open the query on the back end database
Set qdfExisting = dbNew.QueryDefs("qryGetCustomer")
In the existing code there is a function to edit these ad hoc queries
using the DoCmd.OpenQuery function.
DoCmd.OpenQuery "qryGetCustomer", acViewDesign
This works fine in the unsplit version. However, I can't seem to work
out how to pass a query on the remote database into this function.
Not unsurprisingly this doesn't work:
DoCmd.OpenQuery dbNew.QueryDefs("qryGetCustomer"), acViewDesign
Has anyone any ideas on how to solve this?
Thanks
Edward