A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Subform Control



 
 
Thread Tools Display Modes
  #1  
Old August 27th, 2008, 05:32 PM posted to microsoft.public.access.tablesdbdesign
Shri
external usenet poster
 
Posts: 14
Default Subform Control


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.

  #2  
Old August 27th, 2008, 05:58 PM posted to microsoft.public.access.tablesdbdesign
Klatuu
external usenet poster
 
Posts: 7,074
Default Subform Control

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.
--
Dave Hargis, Microsoft Access MVP


"Shri" wrote:


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.

  #3  
Old August 27th, 2008, 07:08 PM posted to microsoft.public.access.tablesdbdesign
Shri
external usenet poster
 
Posts: 14
Default Subform Control

Thank you so much. That helps. I was actually using the name of the form
identified in the control as the source object.

"Klatuu" wrote:

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.
--
Dave Hargis, Microsoft Access MVP


"Shri" wrote:


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.

  #4  
Old August 27th, 2008, 07:48 PM posted to microsoft.public.access.tablesdbdesign
Klatuu
external usenet poster
 
Posts: 7,074
Default Subform Control

That is a very common mistake.
Glad you got it working.
--
Dave Hargis, Microsoft Access MVP


"Shri" wrote:

Thank you so much. That helps. I was actually using the name of the form
identified in the control as the source object.

"Klatuu" wrote:

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.
--
Dave Hargis, Microsoft Access MVP


"Shri" wrote:


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.

 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.