On 28 Apr 2007 15:29:19 -0700, feeman wrote:
I read a previous posting and have tried to use it in my database to
update a table called transaction table, but am having problems with
it.
I have pasted the following into the after event procedure
Private Sub Qty_Delivered_AfterUpdate()
CurrentDb.Execute "UPDATE [Transaction Table] set[delivered] = " &
Me.Qty_Delivered.Value
dbfailonerror
End Sub
It comes back with a compile error sub or function not found.
I am new to vba and am trying to learn as I go along, i wonder if you
could please explain why this will not work.
1) You are missing a space between Set and [Delivered].
Set[Delivered] is not the same as Set [Delivered].
2) Value is the default control property, so you do not need to
expressly state it.
3) You need a comma after the Execute statement if you are going to
use the dbFailOnError argument.
4) If [Delivered] is a Number datatype field, use:
CurrentDb.Execute "UPDATE [Transaction Table] set [Transaction
Table].[delivered] = " & Me.Qty_Delivered, dbfailonerror
If [Delivered' is a Text datatype, then useL:
CurrentDb.Execute "UPDATE [Transaction Table] set [Transaction
Table].[delivered] = '" & Me.Qty_Delivered & "'", dbfailonerror
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail