Set Part of SQL String (1 Viewer)

carlnewboult

Registered User.
Local time
Today, 16:07
Joined
Sep 27, 2005
Messages
90
Hi,

Thanks in advance for any help that you can provide as this is quite a newbie question

I have a table which list all of the items that have to be run for a user and would like to give them some feedback so the questions of is it nearly finished and the like will end.

A form runs which has a subform in it with a table containing all the reports, queries etc etc..... before running the item it places running next to the relevant item and then after completed. Trouble is i cannot get it working

Code:
Private Sub Form_Load()

Dim SQLR As String
Dim SQLC As String

SQLR = "UPDATE table1 SET table1.Status = 'Running' WHERE (((table1.[Query Name])=statementR))"
SQLC = "UPDATE table1 SET table1.Status = 'Completed' WHERE (((table1.[Query Name])=statementC))"

statementR = "tbl3DayChase - NonNU"

DoCmd.RunSQL (SQLR)

DoCmd.RunMacro "Macro1"

DoCmd.RunSQL (SQLC)

End Sub

i get and error saying variable not defined on the statementR = "tbl3DayChase - NonNU"

hope you can help
 

WayneRyan

AWF VIP
Local time
Today, 16:07
Joined
Nov 19, 2002
Messages
7,122
Add single-quote delimiters:

SQLR = "UPDATE table1 SET table1.Status = 'Running' WHERE (((table1.[Query Name]) = '" & statementR& "'))"
SQLC = "UPDATE table1 SET table1.Status = 'Completed' WHERE (((table1.[Query Name]) = '" & statementC & "'))"

Wayne
 

carlnewboult

Registered User.
Local time
Today, 16:07
Joined
Sep 27, 2005
Messages
90
thanks that works a treat oh how i love these forums
 

Users who are viewing this thread

Top Bottom