Solved

Changing a subform's sourceObject

Posted on 2001-08-23
6
570 Views
Last Modified: 2006-11-17
Can you change a subform's sourceObject in an ADP?  In the AfterUpdate event of a combo box I set the subform's SourceObject.  I receive the error

"The setting you entered isn't valid for this property."

Thank you.
0
Comment
Question by:accesslite_
6 Comments
 
LVL 1

Expert Comment

by:kkelln
ID: 6420203
Can you tell me what an ADP is?
0
 
LVL 1

Expert Comment

by:shageman
ID: 6420353
Me.subformwhatever.SourceObject = "subformwhatevername"
0
 
LVL 2

Expert Comment

by:hotbudare
ID: 6420355
accesslite,
Would u please send the code u r using?

kkelln,
ADP: Access Data Project. A new (since A2K) type of access application, specially suited to use SQL as a backn end.

HTH/EQTA
T.S.U. Mario Osorio
Punto Fijo, Falcon, Venezuela
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:accesslite_
ID: 6420545
This was the format (shown below) that I used when I received the error message...

Me.subformwhatever.SourceObject = "subformwhatevername"
0
 
LVL 1

Expert Comment

by:shageman
ID: 6420550
Strange, are you sure you have to correct subform name?
0
 
LVL 1

Accepted Solution

by:
kkelln earned 50 total points
ID: 6421765
I am not sure it matters, but the present syntax offered was:

Me.subformwhatever.SourceObject = "subformwhatevername"

After "Me" is "." - should this read "!":

Me!subformwhatever.SourceObject = "subformwhatevername"

Also, on occassion, I have noticed that using "me" to stand in place of the form name produces unexpected results.  Perhaps try:

Forms!Mainform!subformwhatever.SourceObject = "subformwhatevername"

If none of this works, before changing the source object, try setting the .LinkChildFields and .LinkMasterFields to null or "".  It seems to me that when you change the object source, this should occur by itself but perhaps not.  Maybe the new form does not have the same child field name and this is causing the problem.


Finally, copy the form you are attempting to insert as the source object ("subformwhatevername") - call this new form something simple, like "Test1".  In your naming convention of the new form, restrict yourself to letters only.  Modify your code to refer to this new form and then run it.

If the above test works, then either the name of the form or the form itself is problematic.  If this test fails, create a new form from scratch - put no objects on it.  Give this new form a simple name.  Modify your code accordingly (to refer to the new form) and then test it.

If this fails, go to the form where your subform resides.  Add a new subfrom from the tool bar - do NOT copy and paste from somewhere.  Keep all settings (including the name) the same - blank out the Link child and master fields properties.  When setting up the subform, use a third as yet unrelated form.  Modify your code to refer to the new form and see is it works.

Hope some of this helps.

Kirk out
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question