Solved

MS Access SourceObject

Posted on 2006-06-29
5
1,344 Views
Last Modified: 2008-01-09
This is information that I found out after beating my head for 4+ Hrs. It may help someone else.

I use subforms a lot. In the past if I wanted to use multiple subforms in the same screen area I would use Hide/Visible to get this done. I decided to change the SourceObject of a general subform to make the design form easyer to work with. My first form worked fine and it got me to try it again.

On my second form I did the subform but no records or one record were being displayed after I executed the SourceObject. If I ran the subform all by it's self all the data showed up. I made sure all filters were turned off, but all the data would not show up. I checked the subform info on the parent form and noticed that "ID" was showing up in both the "Link master/child" fields. I set them to "Empty" with VBA code after using the SourceObject but the data did not display. I found that the RecordSource data in both the main form and the subForm had a field named "ID". No mater what I did MS was setting up the Link. I could make the Parent form unbounded or change the field name to be different. I changed the field names and all works well.

I tried all kinds on VBA code syntax.
     Me.Subx1.SourceObject = "subF2"
     Me!Subx1.SourceObject = "subF2"
     Forms!form1!Subx1.SourceObject = "subF2"
Save your time syntax was not the problem. MS was just helping me out tooooooooo much.
0
Comment
Question by:georgefanno
  • 2
5 Comments
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
Is this a question?
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
This "problem" is cause by the subform wizard, but you can prevent a link to a subform by selecting "None" when the wizard asks you for linking fields.

Personally I use a tab control in your situation to have all subforms on the same mainform and just show the needed subform page and hide the buttons so the users don't even know there's a tab control.

Nic;o)
0
 

Author Comment

by:georgefanno
Comment Utility
Thanks for the tip. You get the 100 points.
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 100 total points
Comment Utility
Glad to see I learned you something new :-)

Success with your application !

Nic;o)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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 the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now