Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > BOOK: Access 2010 VBA Programmer's Reference
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Access 2010 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2010 Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Jerry Dennison; ISBN: 978-0-470-59166-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2010 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 13th, 2012, 02:52 PM
Authorized User
Points: 312, Level: 6
Points: 312, Level: 6 Points: 312, Level: 6 Points: 312, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2006
Location: Orpington, Kent, United Kingdom.
Posts: 73
Thanks: 1
Thanked 1 Time in 1 Post
Default Setting 'Source Object' property of subform at Runtime ?

It appears I can set the 'Source Object' property of a subform at design time ( i.e Query.qryReferralsByClient ) but I would like to override this at runtime, and pass my query a variable using WHERE clause( WHERE Client_ID='4' for example ) How do I do this ?
Reply With Quote
  #2 (permalink)  
Old May 13th, 2012, 05:47 PM
Authorized User
Points: 380, Level: 6
Points: 380, Level: 6 Points: 380, Level: 6 Points: 380, Level: 6
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Oct 2010
Posts: 64
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can't you just use the Link Master and Link Child field options? I'm assuming the main form recordset has a field with the Client_ID value and when you move through this recordset you want to display the relevant referrals from your qryReferralsByClient query in the subform!
Reply With Quote
  #3 (permalink)  
Old May 16th, 2012, 02:27 PM
Authorized User
Points: 312, Level: 6
Points: 312, Level: 6 Points: 312, Level: 6 Points: 312, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2006
Location: Orpington, Kent, United Kingdom.
Posts: 73
Thanks: 1
Thanked 1 Time in 1 Post
Default

Thank you. I'm about to try that ( again ).
Reply With Quote
  #4 (permalink)  
Old May 16th, 2012, 02:38 PM
Authorized User
Points: 312, Level: 6
Points: 312, Level: 6 Points: 312, Level: 6 Points: 312, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2006
Location: Orpington, Kent, United Kingdom.
Posts: 73
Thanks: 1
Thanked 1 Time in 1 Post
Default

It says it 'can't build a link between unbound forms' ( I'm using a DoCmd method in the VBA code) for the main form. I know wehn you use the wizard it 'links the Main Form and subform at design time, but I need more flexibility over the recordsets. Hope this makes sense. Here's the main form's code ...

DoCmd.OpenForm "frmAfAIS(test)", , qrySelectClientsByAdvocate, "Advocate_ID=" & rs.Fields("Advocate_ID")

This loads the required records, I now wish to select only records based on a common field 'Client_ID' to both recordsets ( which doesn't actually show on the form ) to display in the subform datasheet view. Thanks.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Data Source class property Colonel Angus ASP.NET 2.0 Professional 5 March 17th, 2008 03:21 PM
setting subform to new record skinny Access 4 January 3rd, 2006 02:57 PM
Runtime property sonurijs ASP.NET 1.0 and 1.1 Professional 0 September 22nd, 2005 11:44 PM
create a Line object ,Box object in CR at Runtime? thanhnt Pro VB 6 1 May 16th, 2005 06:51 AM
Subform - Dynamically Setting mnoon Access 14 March 13th, 2005 07:33 PM



All times are GMT -4. The time now is 09:35 PM.


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