Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 3rd, 2009, 02:48 PM
Avishai Avishai is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 18 Avishai User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 48 m 14 sec
Reputation Power: 0
Question Forms - Changing a sub form's RecordSource

Hello to all!

I have a form with a combo box presenting clients names & ID.
In that form I placed a sub-form with the properties set to datasheet view.
I need to find the syntax for changing the sub-form RecordSource from the ComboBox_AfterUpdate event. from some reason i keep getting an error saying Access cant find the sub-form.

thank you for any help!

Reply With Quote
  #2  
Old July 3rd, 2009, 03:21 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Northern California
Posts: 2,886 don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 1 Day 1 h 18 m 41 sec
Reputation Power: 562
The syntax to refer to a subform can be quite confusing. The best way to do it is to use the Expression Builder, where you can click on the Forms collection, then Open Forms, then your Form, then your Subform, and it will build the correct syntax. You can open the Expression Builder with the toolbar icon that looks like a magic wand with fairy dust (or something!) sprinkling down from it.
__________________
Experience is the thing you have left when everything else is gone.

Reply With Quote
  #3  
Old July 3rd, 2009, 07:50 PM
June7 June7 is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2009
Location: The Great Land
Posts: 535 June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 13 h 47 m 11 sec
Reputation Power: 124
Here is an example from my project that shows referencing subform RecordSource property in VBA code from the parent form:
Code:
Me.ctrSampleList.Form.RecordSource = "SELECT Submit.*, StateNum, ProjectName, ProgCode, LedgerCode, Colo, FedNum, Metric, Remark1, Remark2, Remark3, Remark4, Remark5, Remark6 " & _
"FROM ((Submit LEFT JOIN Projects ON Submit.ProjRecID = Projects.ProjRecID) LEFT JOIN Remarks ON Submit.LabNum = Remarks.LabNum) ORDER BY Submit.LabNum DESC"
Me.ctrSampleList.Form.Requery
This example is very different. I have a form with a tab control and on each tab is a subform. Textboxes on one subform have expression in ControlSource that refers to textboxes on the parent form and other subforms.
Code:
=IIf([Forms]![DataSoilsAgg]![tbxSet] Like "1*",IIf(nz([Forms]![DataSoilsAgg]![ctr1]![tbxLabOneHalf],100)=100,Null,IIf([SScond]="BA" Or [SScond]="CA",100-[Forms]![DataSoilsAgg]![ctr1]![tbxLabOneHalf])),Null)
This next example is in VBA Code. From a dialog form it sets the value of a textbox on the calling form.
Code:
[Form_Transfer].tbxNewDate = Me.tbxDate

Last edited by June7 : July 3rd, 2009 at 10:32 PM.

Reply With Quote
  #4  
Old July 4th, 2009, 12:57 AM
Avishai Avishai is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 18 Avishai User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 48 m 14 sec
Reputation Power: 0
thanks!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Forms - Changing a sub form's RecordSource


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek