Form Refresh/Requery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have this form that is based on a query that is a combination of a make
table query and 2 tables, what I'm trying to do is from a command button on
the form is to: Close the form, run the make tabley query and then open the
form, what happens is that when it tries to run the make table query I get an
error message saying that the table can not be locked as its in use, any
help/instructions on getting around this problem is well recieved.

MTIA
 
While the code behind the command button is running, the form is not
completely closed, so it looks as if it hasn't completely released its
reference to the table which is the result of your make-table query.

You *could* reset the form's RecordSource property, releasing that table,
instead of trying to close the form at all. You could then run your query,
and return the RecordSource property to its original value.

All of which sounds unnecessarily cumbersome. Make-table queries are often
a sign of poor design - why is this one necessary?
 
The table is necessary otherwise most of the queries would a minimum of 15
tables for the required results so I decided to do it once and then call the
table up
and I have some 15 different queries that use the table. If this sounds
cumbersome its because this is for marketing forecasts and we have 12 product
groups with a 'endless' number of products in each one
 
What if you just used a SELECT query and included that in your query design,
instead of doing the make-table?

Your design still sounds a bit suspect to me -
perhaps you could give an example?

Also, since your make-table will always return the same fields (won't it?),
why not just empty and re-populate your table, instead of deleting the whole
table and re-creating it?
 
If I cahnge the make table to selcet query i get an error saying to complex
to proform and thats why I want that route. Haven't tried the second
suggestion yet but will do

TIA
 
Back
Top