chainedtodesk
Programmer
i am trying to set up a job that will run when other jobs or steps have completed. i have a job that runs on a mainframe that changes a date record when the new days business starts, this can happen anytime from 2am to 6am and i need to execute a new job as soon as possible. i tried the following code to run a query verify if the date chaged. it runs through one time but then i get an error that the table used in the query is in use?? any advice, thanks
Option Compare Database
Function chkdate()
Do
DoCmd.SetWarnings False
DoCmd.Hourglass True
Debug.Print "Process Query Check Date"
DoCmd.OpenQuery ("qryCheckDate")
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim sql As Variant
Set dbs = CurrentDb
sql = "Select DateChk from tblDateCheck"
Set rst = dbs.OpenRecordset(sql)
Loop Until sql = "YES"
End Function
Option Compare Database
Function chkdate()
Do
DoCmd.SetWarnings False
DoCmd.Hourglass True
Debug.Print "Process Query Check Date"
DoCmd.OpenQuery ("qryCheckDate")
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim sql As Variant
Set dbs = CurrentDb
sql = "Select DateChk from tblDateCheck"
Set rst = dbs.OpenRecordset(sql)
Loop Until sql = "YES"
End Function