Solved

Changing a subform's sourceObject

Posted on 2001-08-23
6
579 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

756 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