N
NoodNutt
Hi all
Will the following code just remove the newly created QueryDef "qryLHFull"
or will it also delete the data from the original qry "qryLHVol" itself?
Private Sub Report_Close()
Dim dbMyDB As Database, qdMyQuery As QueryDef
Set dbMyDB = DBEngine(0)(0)
Set qdMyQuery = dbMyDB.CreateQueryDef()
qdMyQuery.Name = "qryLHFull"
qdMyQuery.SQL = "DELETE * FROM qryLHVol;"
dbMyDB.QueryDefs.Delete "qryLHFull"
dbMyDB.QueryDefs.Refresh
End Sub
the user will create the query for the report when he/she clicks the CmdBtn
for the report, which works great.
I don't want to nest the new query, once the report is printed & he/she
closes the report, I want to delete the query.
My concern is the line (qdMyQuery.SQL = "DELETE * FROM qryLHVol;")
Will this delete the data in this query, consequently deleteing all the
records in the table it is tied to.
TIA
Mark.
Will the following code just remove the newly created QueryDef "qryLHFull"
or will it also delete the data from the original qry "qryLHVol" itself?
Private Sub Report_Close()
Dim dbMyDB As Database, qdMyQuery As QueryDef
Set dbMyDB = DBEngine(0)(0)
Set qdMyQuery = dbMyDB.CreateQueryDef()
qdMyQuery.Name = "qryLHFull"
qdMyQuery.SQL = "DELETE * FROM qryLHVol;"
dbMyDB.QueryDefs.Delete "qryLHFull"
dbMyDB.QueryDefs.Refresh
End Sub
the user will create the query for the report when he/she clicks the CmdBtn
for the report, which works great.
I don't want to nest the new query, once the report is printed & he/she
closes the report, I want to delete the query.
My concern is the line (qdMyQuery.SQL = "DELETE * FROM qryLHVol;")
Will this delete the data in this query, consequently deleteing all the
records in the table it is tied to.
TIA
Mark.