Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2005, 04:14 AM
Authorized User
 
Join Date: Mar 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Suomi
Default How to display a table in a Subform

Hi,
I am able to display a form within a subform with the following code.

Private Sub Command1_Click()
Forms!MainFormSB!Child14.SourceObject = Form1forDisplay
End Sub

But when I change it to a table display it doesnt work. It doenst give me any error but I see only white subform.

i.e. Forms!MainFormSB!Child14.SourceObject = Table1forDisplay
doesnt work.
Any suggession??
BR,
Silam

 
Old July 1st, 2005, 05:52 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

This might not answer your question, but hopefully it will solve your problem.
Given that your subform works, leave your subform linked in as a form and simply change the "Default view" of your subform to "Datasheet".
 
Old July 1st, 2005, 06:17 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   In your main form, without the subform, change to design view and drag and drop the table from the list of table objects onto the main form. This will create your subform and the default view is datasheet view. Maybe you want something more sophisticated. You can also create a query to display the subform data, and then drag and drop the query in design view, which also creates a datasheet view by default.

HTH

mmcdonal
 
Old July 1st, 2005, 06:18 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

P.S. You may have to manually link parent and child fields using the subforms property dialog box on the Data tab.

mmcdonal
 
Old July 1st, 2005, 09:09 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

That is cool... shame I dont like the datasheet view myself, and hence dont go near the thing... but definitely a nice feature.





Similar Threads
Thread Thread Starter Forum Replies Last Post
populating table from a subform based on a query bjcountry Access 1 April 11th, 2008 06:35 AM
display:table aytacakin J2EE 0 November 23rd, 2005 04:12 AM
display:table aytacakin J2EE 0 November 23rd, 2005 03:58 AM
Subform shows old data from unlinked table donaldmaloney Access VBA 6 May 23rd, 2005 09:37 AM
Display data in a subform marcin2k Access VBA 1 March 1st, 2005 04:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.