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 / November 2007

Tip: Looking for answers? Try searching our database.

No Current Record on form close

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert_L_Ross - 07 Nov 2007 23:32 GMT
I think I know what's causing this but not how to fix it.

I have a subform tied to my main form and when I close the main form when
the subform has no records, I get a "No Current Record" error (no error
number, just the text).

When I close my form and the subform has associated records, everything is
fine.

How can I bypass or prevent this dialog box from appearing when I close a
main form with no related records in the subform?

Thanks!
ruralguy - 08 Nov 2007 02:51 GMT
When you close a form with a SubForm, the MainForm closes 1st and then the
SubForm will close.  Do you have some code in the OnClose or Unload event of
the SubForm?

>I think I know what's causing this but not how to fix it.
>
[quoted text clipped - 9 lines]
>
>Thanks!

Signature

RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Robert_L_Ross - 08 Nov 2007 18:38 GMT
No code on the subform for OnClose or Unload (I had none yesterday, and today
moved it to a tab so now there isn't any OnClose or Unload events for the
subform itself.

The tabs have a MouseMove code, and the main form has OnCurrent and
OnGotFocus events.

The OnCurrent code sets up a recordset clone to check for the total number
of records in the subform to modify the status of some buttons and text
fields.

The OnGotFocus code just requeries the main form.

Do you think any of that would cause this problem?  You said that the main
form unloads, then the subform...can I somehow put code in the OnClose event
of the main form that closes the subform first? (I'm not 100% positive of the
event processing order when forms close)

> When you close a form with a SubForm, the MainForm closes 1st and then the
> SubForm will close.  Do you have some code in the OnClose or Unload event of
[quoted text clipped - 13 lines]
> >
> >Thanks!
ruralguy - 08 Nov 2007 19:25 GMT
You really do not want to change the sequence of events.  As a diagnostic,
just comment out code until the error goes away to locate the problem code.
Once located, there will almost certainly be a better solution.

>No code on the subform for OnClose or Unload (I had none yesterday, and today
>moved it to a tab so now there isn't any OnClose or Unload events for the
[quoted text clipped - 19 lines]
>> >
>> >Thanks!

Signature

RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

 
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.