Multiple subform issues - freeze, object not defined, unknown function

U

unhinged

G'day all,

I am using Access 2000 under Win2000 and encountering some exceedingly
strange errors with some of the subforms in my solution.

The usual error is for Access to freeze upon a requery of the subform
after editing one of the subform records. I have set things up so that
the user has to explicitly modify all records so that I can track
changes and use permissions to restrict the ability to edit data. A
stopgap measure is currently in place until I can set up all of the
users' machines properly - I show a form in Dialog mode and ask for a
password, close the form and then take the user to the editing form
(also in Dialog mode), then close that form and have the main form
requery the subform.

What I have observed is that the first modification to a subform
record is processed correctly - as far as I can tell, anyway. The
subform correctly refreshes to show the changed data and the user can
continue as normal. If, however, the user chooses to modify another
record from the subform, the system will freeze at the end of that
process at the point where the requery occurs. Closing the main form
after the first modification and then re-opening the form to conduct
another modification results in no error.

So, for this first issue, what do I need to look out for?

There is an additional issue that so far only seems to be affecting
one form/subform combination. In this instance, I have an unbound form
showing all records from a table, tEnrolments. Users can click a "New
Enrolment" button and a data entry form opens in Add New, Dialog mode.
Upon saving the changes, the main form code which started the process
issues a requery for the subform - the user is then presented with an
error message of "Object Not Defined" for each record of the subform,
but at the end of this can continue using the system. If the user
tries to add a second enrolment record, the error message that appears
is "Unknown Function" and then the system freezes.

I am bamboozled, as the exact same code works fine on a similar form/
subform combination - any clues?


I have tried moving the requery to the end of the dialog form's save
button code, I have tried in the main form referring to the subform by
the full path (eg [Forms]![swfmEnrolments]!
[sfmqEnrolmentsView].Form.Requery) and by the screen
(Screen.ActiveForm.sfmqEnrolmentsView.Form.Requery) and in all cases I
still receive the error.

Is anyone able to offer assistance?

Thanks,

Daniel.
 
U

unhinged

I have followed all of the advice from the following post by Allen
Browne:
http://groups.google.com.au/group/m...alid+or+no+longer+set&rnum=1#cc18da27e6672d63

Still no joy.

I rebuilt the subform, just in case.

That didn't work either.

I then found this post:
http://groups.google.com.au/group/m...alid+or+no+longer+set&rnum=2#660370830f82d007

It turns out that rather than using a requery method (eg [Forms]!
[swfmEnrolments]![sfmqEnrolmentsView].Form.Requery) you can set the
RecordSource of the subform to a string which is the name of a query,
in this case the same as the existing record source of the subform.

This solved my problem. Hooray!
 
M

Marshall Barton

unhinged said:
I have followed all of the advice from the following post by Allen
Browne:
http://groups.google.com.au/group/m...alid+or+no+longer+set&rnum=1#cc18da27e6672d63

Still no joy.

I rebuilt the subform, just in case.

That didn't work either.

I then found this post:
http://groups.google.com.au/group/m...alid+or+no+longer+set&rnum=2#660370830f82d007

It turns out that rather than using a requery method (eg [Forms]!
[swfmEnrolments]![sfmqEnrolmentsView].Form.Requery) you can set the
RecordSource of the subform to a string which is the name of a query,
in this case the same as the existing record source of the subform.

This solved my problem. Hooray!

Very strange that Requery didn't do it.

Thanks for posting your final resolution,
 
U

unhinged

Well, looks like I spoke too soon...

Another user has informed me that the problem is still extant. I have
tried using code which closes the main form (swfmEnrolments) and
reopens it; apparently this is also exhibiting the faulty behaviour.
Since I have already rebuilt the subform I guess the only thing I can
do is rebuild the main form and see what happens.

Wish me luck, folks.
 
M

Marshall Barton

unhinged said:
Well, looks like I spoke too soon...

Another user has informed me that the problem is still extant. I have
tried using code which closes the main form (swfmEnrolments) and
reopens it; apparently this is also exhibiting the faulty behaviour.
Since I have already rebuilt the subform I guess the only thing I can
do is rebuild the main form and see what happens.


If you suspect corruption in the form, First make a a backup
copy of the file in case your attempts to reparir it makes
things worse.

Then, try using Decompile
http://www.granite.ab.ca/access/decompile.htm

Or creating a new, blank mdb with all the appropriate
settings (esp. turn off NameAutoCorrect). Then Import
everything from the problem mdb.
 

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