A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro Fails Due to Table Locked



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2008, 01:46 PM posted to microsoft.public.access.forms
LLFK
external usenet poster
 
Posts: 3
Default Macro Fails Due to Table Locked

I have a standalone form with a page that contains a subform linked to a
query. In order to update the subform data, I created a macro to run several
queries that will ultimately update the query the subform is linked to. In
my macro, I close the main form, run all of the queries and then re-open the
main form with a GoToControl to get it to go right back to the page where the
subform resides. I continue to get an error with my macro that states it
can't run my queries because the table is already in use.

When I manually close the main form and run the macro, it works fine.

Any thoughts?
  #2  
Old April 13th, 2008, 11:30 PM posted to microsoft.public.access.forms
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default Macro Fails Due to Table Locked

The form is not closing fast enough for your queries to be able to gain
access to the table. This likely is a timing issue. Any particular reason
you cannot update the data directly in the subform without having to run the
external queries?

Otherwise, you'll need to run a macro to close your current form, open
another form, and then run a macro from that form that will do the updates
(that should ensure that the first form is fully closed).
--

Ken Snell
MS ACCESS MVP



"LLFK" wrote in message
...
I have a standalone form with a page that contains a subform linked to a
query. In order to update the subform data, I created a macro to run
several
queries that will ultimately update the query the subform is linked to.
In
my macro, I close the main form, run all of the queries and then re-open
the
main form with a GoToControl to get it to go right back to the page where
the
subform resides. I continue to get an error with my macro that states it
can't run my queries because the table is already in use.

When I manually close the main form and run the macro, it works fine.

Any thoughts?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.