Update Query

A

Andy Levy

Hi

I am trying to run the following query on a table (consultform), that is
already open and displaying as a continuous form.

Dim pst As ADODB.Recordset
Set pst = New ADODB.Recordset
pst.ActiveConnection = CurrentProject.Connection
pst.CursorType = adOpenDynamic
pst.LockType = adLockOptimistic

'THE QUERY
pst.Open "UPDATE master SET filter = '0' WHERE filter = '-1' "

but each time i run the code i get the following

'operation not allowed when object closed'

is it bcos the recordset is already open? is there a way round it ?

thanks

AL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top