table in use

  • Thread starter Jean-Paul De Winter
  • Start date
J

Jean-Paul De Winter

Hi,
In my code I get an errormessage saying a table is still open and not
accessable
I use some queries to filter out records
Is there a way to figure out which query keeps the main table open?
Thanks
JP
 
J

J

Not that I know of.


Go into every one of your queries and make sure its properties include
Record Locks = No Locks (OR) Record Locks = Editted Record. That
should fix your problem.

~J
 
J

Jean-Paul De Winter

Alas, problem not solved...

The code is as follow:
SQL2 = "SELECT patienten.* FROM patienten WHERE patienten.naam = '" &
replace(TB!Naamll, "'", "''") & "' ;"
Set TB_naam = db.OpenRecordset(SQL2)
TB_naam.Edit
TB_naam!gedrag = True
TB_naam.Update
TB.Update

TB.MoveNext
Loop


TB.Close
DoEvents
Set TB = Nothing
Set db = Nothing

DoCmd.OpenReport "Gedrag_rapport", acViewPreview

TB_naam.Close
TB_Klas.Close
DoEvents
Set TB_naam = Nothing
Set TB_Klas = Nothing

DoCmd.OpenReport "Gedrag_OK", acViewPreview


In the query where "Gedrag_OK" is based upon I use the "patienten" table...

In sql2 (as you can see higher) I use it for the last time...
I thought I closed it with TB_naam.close

Now what??

Thanks
 
Top