I am writing a simple piece of SQL query to update a table in my test database, but I am encountering problems:
Public Sub UpdateStatus(TypeName As String)
Dim DBase As Database
Dim SQLCommand As String
Dim qdfChange As QueryDef
SQLCommand = "Update Case SET Status = 1 WHERE TypeName = '" & TypeName & "';"
Debug.Print SQLCommand
Set DBase = OpenDatabase("C:\TestDatabase\CaseSet.accdb")
Set qdfChange = DBase.CreateQueryDef("", SQLCommand)
qdfChange.Execute
End Sub
The field names in table Case match the ones in my SQL query.
(If this is of any value, this function belongs to a form)
barandfoo? - JNevillbargetting properly set? Can you put a breakpoint on theSQLCommand=line and verify thatbarhas a value? - JNevillfield1? Can you actually put the SQL statement which should not reveal personal/proprietary data? - Parfait