[AccessD] Method 'SourceObject' of object...SOLVED

Steve Capistrant scapistrant at symphonyinfo.com
Fri Nov 7 10:52:06 CST 2003


Problem solved!  Best yet, it turns out to be a programming mistake
masquerading as a corruption.  An error type unhandled smoothly by Jet or
VB, so results in a crash.

We have a person "container form" with one main subform control that swaps
out different forms (by changing the SourceObject) to show different
information about the person.  The problem was in the Volunteer area.
People by default are not "volunteers", so the Volunteer subform by default
presents a simple screens saying "no record is yet set up", and gives a
button which allows them to first create a volunteer record, then flip to
the subform that allows them to view/edit.  We already do this happily in
the Member and Customer areas, for which the same rule apply.  The
difference here was that I had one required field (volunteer type) to ask
the user about, so I presented a popup to capture it.  But I was using the
code from Member and the Customer sections, and failed to remove the line
that switches the subform.  So I was prematurely calling a subform that had
no data (yet) to support it.

The prize for solving the problem goes to fellow AccessD posters in our
office:  Mark Whittinghill and Liz Doering.  Thanks everyone else for your
ideas.  As usual, you are wonderful.

Steve Capistrant
Symphony Information Services
scapistrant at symphonyinfo.com
www.symphonyinfo.com
Phone: 763-391-7400
7308 Aspen Lane North, Suite 132
Brooklyn Park, MN 55428

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of MartyConnelly
Sent: Thursday, November 06, 2003 10:59 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Method 'SourceObject' of object...


I just wonder if it could be something along these lines
To refer to a control on a subform, use the following syntax:

Forms![main form name]![subform control name].Form![control name]

It is important to note that you cannot refer to controls on a subform
with the following syntax:
Forms![subform name]![control name]

This is because a subform on a main form is not a form, but is a control
just like a text box or a list box. You must refer to a subform as a
control rather than a form, and specify the Form identifier following
the subform control name reference to gain access to the controls on a
subform.

ACC2000: How to Refer to a Control on a Subform or Subreport
http://support.microsoft.com/default.aspx?scid=kb;en-us;209099&Product=acc
Steve Capistrant wrote:

>Charlotte,
>
>1. Yes, that's the literal message, referring to object names that are not
>found anywhere in my code or object set.
>2.  Using Access 2000.
>3.  I don't understand your distinction about runtime engines.  The app
>compiles cleanly, and compacts without complaint.  But when I start hitting
>a few areas with subforms, I get a hailstorm of these errors.  I can turn
on
>error pausing and see where it trips up, and the code lines are all
>different, but they do have the common thread of assigning various subform
>names to the container form's subform's SourceObject.
>4.  Oops, you are right -- I meant "SourceObject".  The offending lines
read
>like:
>forms!frmPerson!subSection.SourceObject = "frmPerson_SubVolunteer"
>
>Steve Capistrant
>Symphony Information Services
>scapistrant at symphonyinfo.com
>www.symphonyinfo.com
>Phone: 763-391-7400
>7308 Aspen Lane North, Suite 132
>Brooklyn Park, MN 55428
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Charlotte
>Foust
>Sent: Thursday, November 06, 2003 7:29 PM
>To: Access Developers discussion and problem solving
>Subject: RE: [AccessD] Method 'SourceObject' of object...
>
>
>Is that the literal error message, or do 'SourceObject' and '_SubForm'
>stand as placeholders?   What version of Access are you using and What
>file format?  Are you getting the message when someone attempts to run
>the application using the runtime engine or is it an error that
>*happens* at runtime?  Is the error triggered on methods like
>"ControlSource" or did you mean "SourceObject" rather than what you
>typed?
>
>Charlotte Foust
>
>-----Original Message-----
>From: Steve Capistrant [mailto:scapistrant at symphonyinfo.com]
>Sent: Thursday, November 06, 2003 5:04 PM
>To: Access Developers discussion and problem solving
>Subject: [AccessD] Method 'SourceObject' of object...
>
>
>Help!!  Our main database has been corrupted, displaying this:
>
>" Run-time Error '-2147417848 (80010108): Method 'SourceObject' of
>object '_SubForm' failed "
>
>from a variety of contexts.  How do I shake it?   Nothing in MSKB.
>We're
>using Source Safe, and even totally rebuilt versions still have the
>corruption, and it happens on all workstations.  Triggered on lines like
>this:
>forms!frmPerson!subSection.ControlSource = "frmPerson_SubVolunteer"
>
>Steve Capistrant
>Symphony Information Services
>scapistrant at symphonyinfo.com
>www.symphonyinfo.com
>Phone: 763-391-7400
>7308 Aspen Lane North, Suite 132
>Brooklyn Park, MN 55428
>
>
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>
>

--
Marty Connelly
Victoria, B.C.
Canada



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list