mmaginniss
Technical User
I am trying to take the values a user would type into two text fields and plug those two values into a SQL update query. I am trying to do this using variables. Does anyone know where I might be going wrong... Thx. Here's my code:
' Take the value of txtAddOne Begin and
' txtAddOneStop and plug it into the SQL
' update query
Private Sub cmdDoIt_Click()
Dim intValueOne As Integer
Dim intValueTwo As Integer
intValueOne = Me!txtAddOneBegin.Value
intValueTwo = Me!txtAddOneStop.Value
DoCmd.RunSQL "UPDATE tblProjects " & _
"SET tblProjects.ProjPriority = [ProjPriority]+1 " & _
"Between 'intValueOne' And 'intValueTwo'; "
DoCmd.Requery
DoCmd.Close
End Sub
' Take the value of txtAddOne Begin and
' txtAddOneStop and plug it into the SQL
' update query
Private Sub cmdDoIt_Click()
Dim intValueOne As Integer
Dim intValueTwo As Integer
intValueOne = Me!txtAddOneBegin.Value
intValueTwo = Me!txtAddOneStop.Value
DoCmd.RunSQL "UPDATE tblProjects " & _
"SET tblProjects.ProjPriority = [ProjPriority]+1 " & _
"Between 'intValueOne' And 'intValueTwo'; "
DoCmd.Requery
DoCmd.Close
End Sub