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 / December 2005

Tip: Looking for answers? Try searching our database.

Transferring data from main form to subform not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Susan L - 16 Dec 2005 21:30 GMT
I want a control on a subform (on a Tab) to inherit a value under certain
conditions when two other controls on the main form are filled. The code is
in the After Update event of a third control on the main form. The code is
below. I have used the control name that contains the subform, not the name
of the form itself, which I've read at MSDN is the proper syntax.
Have received numerous errors as I've been tinkering, trying to make it
work, but the current message is that Access can't find the control name
Tab7_QUICK (This is not the name of the Tab -- it's the control that holds
the form). I've double-checked the name as well as that of the control on
that subform (txtError). There must be a syntax problem. Here's the code,
along with my comment.

'Enters the QUICK application error on the QUICK Error tab
   If Me.[ProgramID] = 5 And Me.[CategoryID] = 2 Then
       Forms![Tab7_QUICK]![txtError] = Me.[cboDescription].[Column](3)
   End If
Would appreciate any suggestions.
Signature

susan

Ken Snell (MVP) - 17 Dec 2005 00:32 GMT
A subform is not open on its own when part of a parent form. Instead, you
must reference it through the parent form, and you must use the name of the
subform control (the control that holds the subform object in the main
form):

Forms!NameOfParentForm!NameOfSubformControl![txtError] =
Me.[cboDescription].[Column](3)
Signature


       Ken Snell
<MS ACCESS MVP>

>I want a control on a subform (on a Tab) to inherit a value under certain
> conditions when two other controls on the main form are filled. The code
[quoted text clipped - 15 lines]
>    End If
> Would appreciate any suggestions.
Susan L - 17 Dec 2005 18:52 GMT
Thanks, Ken. Your response solved not one, but three problems! Thanks again.
Signature

susan

> A subform is not open on its own when part of a parent form. Instead, you
> must reference it through the parent form, and you must use the name of the
[quoted text clipped - 22 lines]
> >    End If
> > Would appreciate any suggestions.
Ken Snell (MVP) - 17 Dec 2005 19:25 GMT
Three for the price of one... not a bad deal! Glad it's working for you.
You're welcome.

Signature

       Ken Snell
<MS ACCESS MVP>

> Thanks, Ken. Your response solved not one, but three problems! Thanks
> again.
[quoted text clipped - 33 lines]
>> >    End If
>> > Would appreciate any suggestions.
 
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.