also, the subform is not determined until the main form is loaded. I use
the following function
------------------------
Public Sub UpdateAppSource()
Dim strAbstractForm As String
Dim strStrategyArea As String
Dim strPhase As String
strStrategyArea = IIf(IsNull(Left(StrategyArea, 3)), "", Left(StrategyArea,
3))
strAbstractForm = ""
strPhase = ""
If (strStrategyArea = "CBA") Or (strStrategyArea = "CBO") Or
(strStrategyArea = "CCD") Then
If (PhaseID = 1) Or ((PhaseID = 2) And (Left(MTCID, 5) = "00100")) Then
strPhase = "PI"
End If
strAbstractForm = "subfrm" & strStrategyArea & "AbstractData" & strPhase
subfrmAbstractData.SourceObject = strAbstractForm
subfrmAbstractData.LinkChildFields = "GranteeActivityID"
subfrmAbstractData.LinkMasterFields = "GranteeActivityID"
Else
subfrmAbstractData.SourceObject = "frmBlank"
End If
GLBL_SubFormName = strAbstractForm
subfrmAbstractData.Requery
Me.Refresh
End Sub
--------------------------
Maybe the call should be CALL me.subfrmAbstractData.form.LockEdit ????
Dirk Goldgar said:
LisaB said:
I am trying to get a call statement to work with a global name that
will be passed to the function. What is the correct syntax
This works if I use the actual form name
Call Me.[subtblGranteeContacts].Form.LockEdit
This does not work (trying to pass the form name through a global
variable) Call Me.[(GLBL_SubFormName)].Form.LockEdit
Call Me(GLBL_SubFormName).Form.LockEdit
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)