P
PiB311
Hello all,
Hope someone can help me. I created a table with different procedures that
run during a nightly update process. I wanted to be able to skip one part if
something failed.
To do this, I created a table that specifies a process number and the script
that is run to complete that process.
I need to be able to loop through records and run specific scripts that
should be completed. When I try the call method of the variable, I get
"Compile error: expected: . or (".
Here is my code.
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim str_sql As String
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * " & _
"FROM tbl_processes " & _
"INNER JOIN tbl_scripts " & _
"WHERE tbl_processes.task_id = " & int_task &
"")
rst.MoveFirst
Do Until rst.EOF
str_sql = "INSERT INTO tbl_process_log ( process_id , status_id ,
error_message , error_action ) " & _
"SELECT " & rst!process_id & ", 1, '','' "
DoCmd.SetWarnings False
DoCmd.RunSQL str_sql
DoCmd.SetWarnings True
call rst!script
Please assist. Any help is appreciated!
Hope someone can help me. I created a table with different procedures that
run during a nightly update process. I wanted to be able to skip one part if
something failed.
To do this, I created a table that specifies a process number and the script
that is run to complete that process.
I need to be able to loop through records and run specific scripts that
should be completed. When I try the call method of the variable, I get
"Compile error: expected: . or (".
Here is my code.
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim str_sql As String
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * " & _
"FROM tbl_processes " & _
"INNER JOIN tbl_scripts " & _
"WHERE tbl_processes.task_id = " & int_task &
"")
rst.MoveFirst
Do Until rst.EOF
str_sql = "INSERT INTO tbl_process_log ( process_id , status_id ,
error_message , error_action ) " & _
"SELECT " & rst!process_id & ", 1, '','' "
DoCmd.SetWarnings False
DoCmd.RunSQL str_sql
DoCmd.SetWarnings True
call rst!script
Please assist. Any help is appreciated!