Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"object invalid or no longer set" 4320 code error...

Status
Not open for further replies.

gurtl79

Programmer
Jun 19, 2003
7
SI
Could someone please help me?
In the following code I get object invalid or no longer set error.
I would like to update some records after updating a discount text field (popust_A) without any confirmation window or something like by "runsql" object.

---------------------------------
Private Sub popust_a_AfterUpdate()

Dim dbs As Database, qdf As QueryDef
Dim pop, popkof As Single
Dim popkofstring, strsql, pon as String

IDPonudbe = Me.ponudba
popA = Me.popust_a
popkof = 1 - (Me.popust_a / 100)

popkofstring = Str(popkof)
pon = Str(IDPonudbe)


Set dbs = CurrentDb

strSQL = "UPDATE Cenik_PPL_tbl INNER JOIN podsklop_referenca ON Cenik_PPL_tbl.REF = podsklop_referenca.ref SET podsklop_referenca.znesek = [podsklop_referenca].[cena]*[podsklop_referenca].[kolicina]*" & popkofstring & " WHERE (((podsklop_referenca.grupa1)='A') AND ((podsklop_referenca.[#ponudbe])=" & pon & "));"

Set qdf = dbs.CreateQueryDef(, strSQL)

qdf.Execute <-- here is the problem

Set dbs = Nothing

End Sub
 
Don't bother, I've just done it with docmd.runsql, setting the warnings off, and it's working very well.

thanky anyway.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top