I am adding queries that I created in Access to run in an application.
I have given you the meat of the subroutine.
The tabledefs.delete is working. It is the rest of the process that is not working.
The queries are not displaying any data when I know there is data. If I run in Access, I get data.
If you could let me know what I have wrong, I would greatly appreciate it.
The code is below.
Thanks in advance!!
Eddi Rae

I have given you the meat of the subroutine.
The tabledefs.delete is working. It is the rest of the process that is not working.
The queries are not displaying any data when I know there is data. If I run in Access, I get data.
If you could let me know what I have wrong, I would greatly appreciate it.
The code is below.
Code:
Dim db As Database
Dim ws As Workspace
Dim qry As QueryDef
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(sStatsPath)
For i = 0 To imt
db.TableDefs.Delete ("Stp01-DailyDetail")
db.TableDefs.Delete ("Stp02-ReschedEst")
db.TableDefs.Delete ("Stp03-Manhours")
'Remove data for date
Set qry = db.QueryDefs("DELETE")
qry.Parameters("calc_date") = calcdate
qry.Execute
qry.Close
Set qry = db.QueryDefs("ACCESS_Raw Data - D")
qry.Parameters("calc_date") = calcdate
qry.Execute
qry.Close
Set qry = db.QueryDefs("ACCESS_Res-Est-S")
qry.Parameters("calc_date") = calcdate
qry.Execute
qry.Close
Set qry = db.QueryDefs("ACCESS_Manhour-S")
qry.Parameters("calc_date") = calcdate
qry.Execute
qry.Close
Set qry = db.QueryDefs("Answers-S")
qry.Parameters("calc_date") = calcdate
qry.Execute
qry.Close
calcdate = DateAdd("d", 1, calcdate)
Next i
Thanks in advance!!
Eddi Rae

Last edited: