Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / September 2007

Tip: Looking for answers? Try searching our database.

subform to subform assistance

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnE - 29 Sep 2007 06:25 GMT
Hello Newsgroup.  I have a dilemma regarding referencing a subform to a
subform in an expression.  Below is the expression and it is not working
properly.  This expression is in a textbox on a subform that needs to count
how many comments there are based on the other subform (which is the foreign
key in the subform the expression is in.

=DSum("[VehicleMaintenanceCommentID]","[tblVehicleMaintenanceComment]","[VehicleMaintenanceID] = sfrmVehicleMaintenanceSubform.Form!VehicleMaintenanceID")

I thank anyone who responds to this.

.... John
shanesullaway - 29 Sep 2007 07:14 GMT
Hey John,

Follow the link below and see if it doesn't shed some light on your situation.

http://www.mvps.org/access/forms/frm0031.htm

HTH,
Shane

>Hello Newsgroup.  I have a dilemma regarding referencing a subform to a
>subform in an expression.  Below is the expression and it is not working
[quoted text clipped - 7 lines]
>
>.... John
JohnE - 29 Sep 2007 18:55 GMT
Shane, thanks for the info but it didn't.  I'll see if I can clarify, the
main form has 2 subforms on it (Sub1 & Sub2 for simplicity).  Sub1 is the
many to the one of the main form and Sub2 is the many to the on of Sub1.  
Sub2 has the txtbox on it that is counting how many in Sub2 there are that
match the one in Sub1.  I got to this but it still isn't working like it
should.  The ID and tbl are for Sub2 and the criteria is for Sub1.

=DSum("[VehicleMaintenanceCommentID]","[tblVehicleMaintenanceComment]","[VehicleMaintenanceID]='Form!Sub1!VehicleMaintenanceID'")

So if you or any others know how it should be, thanks, because I am at a
loss.  It is the criteria part of the expression

... John

> Hey John,
>
[quoted text clipped - 16 lines]
> >
> >.... John
shanesullaway - 30 Sep 2007 06:35 GMT
John,

I hope I'm following you correctly so here goes a stab at it.  (criteria part
only since thats all you need help on)

"[VehicleMaintainceID] = " & Forms![MainFormName]![subform1].Form!
[VehicleMaintenanceID]   (this is assuming VehicleMaintenanceID is a number)

HTH,
Shane

>Shane, thanks for the info but it didn't.  I'll see if I can clarify, the
>main form has 2 subforms on it (Sub1 & Sub2 for simplicity).  Sub1 is the
[quoted text clipped - 15 lines]
>> >
>> >.... John
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.