update

G

Guest

For some reason the following code will not work, I get an error on the from
clause - does anyone see anything wroong with it or another way to do the
same thing

Private Sub Command95_Click()

Dim rst As New ADODB.Recordset
Dim SqlStmt As String

SqlStmt = "SELECT * FROM Values WHERE ID = " & TextTEST
rst.Open SqlStmt, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic


While Not rst.EOF
rst!ORDER_STATUS = "OK"
rst.Update

rst.MoveNext
Wend

MsgBox "TABLE UPDATED"
TextTEST = ""
End Sub
 
N

Nick Coe \(UK\)

1/ I suspect use of the word Values as a table name could be
a problem since it's used by Access/VBA.

2/ If you paste the SQL into SQL mode of the query designer
(with any substitutions made for TextTEST) does it work?

--
Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp is now Free
http://www.mrcomputersltd.com/ Repairs Upgrades

In tiredoftrying typed:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top