Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
unhinged - 18 May 2007 00:49 GMT
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.
unhinged - 21 May 2007 02:44 GMT
I have followed all of the advice from the following post by Allen
Browne:
http://groups.google.com.au/group/microsoft.public.access.formscoding/browse_thr
ead/thread/ea9cfa487574dc3a/cc18da27e6672d63?lnk=gst&q=object+invalid+or+no+long
er+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/microsoft.public.access.formscoding/browse_thr
ead/thread/270ad91bf1581c96/660370830f82d007?lnk=gst&q=object+invalid+or+no+long
er+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!
Marshall Barton - 21 May 2007 19:09 GMT
>I have followed all of the advice from the following post by Allen
>Browne:
[quoted text clipped - 15 lines]
>
>This solved my problem. Hooray!

Very strange that Requery didn't do it.

Thanks for posting your final resolution,

Signature

Marsh
MVP [MS Access]

unhinged - 22 May 2007 07:22 GMT
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.
Marshall Barton - 22 May 2007 15:44 GMT
>Well,  looks like I spoke too soon...
>
[quoted text clipped - 3 lines]
>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.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.