hi, I have a problem with a insert query in vba acces. each time run it, there is an error message "run-time error 424, Object require"
the dbs.execute ("insert into...") is highlighted!!
can anyone help me?
thanks
tarounen.
Code:
Private Sub Save_Click()
Dim dbs As Database
Set dbs = CurrentDb
'Insert all records of selected film id in tickets table
dbs.Execute ("INSERT INTO tickets_tbl ( pid, seats, total )SELECT projections_tbl.pid, temp1.seats, " & Str(Froms!tickets!total) & " FROM Projections_tbl, temp1 WHERE sel = true and Projections_tbl.rid = temp1.rid")
'Update number of seats left in projection table
dbs.Execute ("UPDATE projections_tbl INNER JOIN temp1 ON projections_tbl.rid = temp1.rid SET seats_left = seats_left-temp1.seats WHERE fid = " & Str(Forms!tickets!fid) & "")
'Delete all contents in temp1
dbs.Execute ("DELETE * FROM temp1")
'clear total,paind and change
Me.paid = ""
Me.change = ""
Me.fid = ""
Me.title = ""
Me.duration = ""
Me.rated = ""
Me.Refresh
End Sub
can anyone help me?
thanks
tarounen.
Comment