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 / February 2008

Tip: Looking for answers? Try searching our database.

Referring to Master Form Controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
unclemuffin - 05 Feb 2008 15:09 GMT
Using Access 2007 I have setup nested forms.

Master Form is frmOrder which has a subform frmCut which has a subofrm
frmRoll.

On frmCut i have a control named BiasSize

On frmRoll I want to refer to the control BiasSize on frmCut

I have the following code in the AfterUpdate event of another control
on frmRoll:

Private Sub cmdActualYardsEntered_AfterUpdate()
   Dim intBiasSize As Single
   Dim BiasMultiplier As Single

   intBiasSize = Forms![frmCut]!BiasSize  ' Error occurs here

If intBiasSize > 0 Then
       If intBiasSize = 1.5 Then BiasMultiplier = 43
       If intBiasSize = 3 Then BiasMultiplier = 20
       Me![cmdActualyd] = Me![cmdActualYardsEntered] * BiasMultiplier
   Else
       Me![cmdActualyd] = ([cmdInchesOnSpread] + [InchesOfWaste]) /
36
   End If

End Sub

I am getting an error: Run-time error '2450': Microsoft Office Access
can't find the form 'frmCut' referred to in a macro expression or
Visual Basic code.

frmCut is the correct name of the form.

I am a newbie and kind of jumped into VBA without some of the
underlying knowledge of how to refer to different objects.  So please
forgive me if this is a simple question.

Brent
Maurice - 05 Feb 2008 15:35 GMT
Try:

intBiasSize = me.parent!BiasSize

see if that works
Signature

Maurice Ausum

> Using Access 2007 I have setup nested forms.
>
[quoted text clipped - 36 lines]
>
> Brent
unclemuffin - 05 Feb 2008 17:08 GMT
I solved my own problem.

I was attempting to refer to the name of the form instead of the
actual subform control name.

I used the following to get it to work:

intBiasSize = Forms![frmOrder]![subfrmCut]!BiasSize

where subfrmCut is the name of the subform in frmOrder

> Try:
>
[quoted text clipped - 44 lines]
>
> > Brent
 
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.