updating code..

mfuada

Registered User.
Local time
Today, 21:58
Joined
Feb 4, 2009
Messages
63
hey guys this is my code:

Private Sub Command43_Click()
Dim reop_dbvar As DAO.Recordset
Dim dbs_var As DAO.Database, sql As String
Dim dbs_var2 As DAO.Database, sql2 As String
Dim strface As String
strface = Me!series_reoptxtvar.Value
Set reop_dbvar = CurrentDb.OpenRecordset("reop_var")
Set dbs_var = CurrentDb
reop_dbvar.AddNew
reop_dbvar!date_reop_var = Me!reop_datetxtvar
reop_dbvar!reop_series_var = Me!series_reoptxtvar
reop_dbvar!reop_coupon_var = Me!reop_coup_var
reop_dbvar!reop_outs_var = Me!outs_reoptxtvar
reop_dbvar!reop_comment_var = Me!reop_commentvar
reop_dbvar.Update
sql = "UPDATE var_coupon SET face_value_var = " & outs_reoptxtvar.Value & " where (([var_coupon].[series_var]) like '*" & strface & "*')"
dbs_var.Execute sql, dbFailOnError
sql2 = "UPDATE var_coupon SET coupon_var = " & reop_coup_var.Value & " where (([var_coupon].[series_var]) like '*" & strface & "*')"
dbs_var2.Execute sql2, dbFailOnError
MsgBox "Outstanding baru = " & outs_reoptxtvar.Value
List18.Requery
End Sub


what i would like to do is to run the sql2 in this script.... but i got the error message "object variable or With block variable not set" is there any proper way to run 2 sql in the same time?
thx
 
The second variable, dbs_var2, is never set. There is actually no need for it; just use the first one.
 

Users who are viewing this thread

Back
Top Bottom