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 / Database Design / August 2008

Tip: Looking for answers? Try searching our database.

Subform Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shri - 27 Aug 2008 17:32 GMT
Hi,

I need some help in refering a subform control in a parent form.

I have below line in Parent form which is called as "frm_edit_front_end",
Subform is called as "sub_frm_appeal".

Call load_appeal_data("frm_edit_front_end", "sub_frm_appeal")

I have below code in the Module.
*******************************
Public Sub load_appeal_data(frm As String, subfrm As String)
Set dbslog = CurrentDb
sSql = "SELECT * FROM tbl_appeal_new WHERE SSN = '" & social & "' and AppSeq
= '" & App & "' and AuditType = '" & Audit & "' and ProdSeq = '" & Prod & "'"

Set rstlog = dbslog.OpenRecordset(sSql, dbOpenSnapshot)
With rstlog
Forms(frm)(subfrm)("appeal_comments") = !appeal_comments
end with
******************************

"appeal_cooments" is a control in a subform. I get an error message as "MS
can't find the field "sub_frm_appeal". Could you please anyone help me in
solving this issue.

I appreciate all your help.

Thanks.
Klatuu - 27 Aug 2008 17:58 GMT
The syntax from the parent form is:
Me!SubformControlName.Form!ControlOnSubformName

Where SubformControlName is the name of the subform control on the main
form, not the name of the form identified in the control as the source object.
Signature

Dave Hargis, Microsoft Access MVP

> Hi,
>
[quoted text clipped - 25 lines]
>
> Thanks.
Shri - 27 Aug 2008 19:08 GMT
Thank you so much.  That helps.  I was actually using the name of the form
identified in the control as the source object.

> The syntax from the parent form is:
> Me!SubformControlName.Form!ControlOnSubformName
[quoted text clipped - 31 lines]
> >
> > Thanks.
Klatuu - 27 Aug 2008 19:48 GMT
That is  a very common mistake.
Glad you got it working.
Signature

Dave Hargis, Microsoft Access MVP

> Thank you so much.  That helps.  I was actually using the name of the form
> identified in the control as the source object.
[quoted text clipped - 34 lines]
> > >
> > > Thanks.
 
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



©2010 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.