Thanks! I'll try that out... but I found also
the "update" statement, which used
update tblName
set field - value
where conditional statement
Any further information on this??? I tried it, but got
errors, when I had it one three separate lines like this,
I got an error that 'tblName' was not defined. Then I
tried to move it to one line and I got an error on "set"
something like "(" expected... I don't remember the exact
error. But if there is a reference of some sore form
more information I would appreciate it. I didn't find
anything on Knowledge base or google.
Thanks for any further information! For now, I'll
probably use what you have, but I would like to learn
more about the other!
THANKS AGAIN!
>-----Original Message-----
>
[quoted text clipped - 27 lines]
>http://go.compuserve.com/msdevapps?loc=us&access=public
>.
John Vinson - 12 Jan 2004 18:49 GMT
>Thanks! I'll try that out... but I found also
>the "update" statement, which used
>
>update tblName
>set field - value
>where conditional statement
This is a SQL query, not VBA code. Trying to execute this as if it
were VBA geht eben so schlecht als switching to German in the middle
of an English sentence!
>Any further information on this??? I tried it, but got
>errors, when I had it one three separate lines like this,
[quoted text clipped - 8 lines]
>probably use what you have, but I would like to learn
>more about the other!
You can create and execute a SQL Query in several ways: e.g.
DoCmd.RunSQL "UPDATE tblName SET Fld1 = 'Some Text' WHERE fld2 = 3;"
or (preferably since it traps errors)
Dim strSQL As String
strSQL = "UPDATE tblName SET Fld1 = 'Some Text' WHERE fld2 = 3;"
Dim db As DAO.Database
Dim qd As DAO.Querydef
Set db = CurrentDb
Set qd = db.CreateQuerydef(strSQL)
On Error GoTo Proc_Error
qd.Execute dbFailOnError
...
Proc_Error:
<your error handling code here>
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public