D
David Altemir
Hello ...
I've got the following code under a button in an Access 2000 main form
called "CAList":
stDocName = "CAEditor"
stLinkCriteria = "CAID = " & Me.CAListSubForm![CAID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
I get a "Access can't find the field 'CAListSubForm' referred to in
your expression" error. But the same coding approach works without
error in an analogous case that I have defined in another main form,
"NCRList":
stDocName = "NCREditor"
stLinkCriteria = "NCRID = " & Me.NCRListSubForm![NCRID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Therefore, the same kind of statement works for "CAList" but not
"NCRList"!!! "CAList" and "NCRList" are main forms that are open when
each of these code bits are executed, respectively.
Can anyone tell me what fundamental problem am I having when referring
to field values in a subform? My inclination would have been to use
exclamation marks in the field path names (i.e.,
Me!NCRListSubForm![NCRID]) instead of a period, but like I say, the
period worked for me in "NCRList".
-- David
I've got the following code under a button in an Access 2000 main form
called "CAList":
stDocName = "CAEditor"
stLinkCriteria = "CAID = " & Me.CAListSubForm![CAID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
I get a "Access can't find the field 'CAListSubForm' referred to in
your expression" error. But the same coding approach works without
error in an analogous case that I have defined in another main form,
"NCRList":
stDocName = "NCREditor"
stLinkCriteria = "NCRID = " & Me.NCRListSubForm![NCRID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Therefore, the same kind of statement works for "CAList" but not
"NCRList"!!! "CAList" and "NCRList" are main forms that are open when
each of these code bits are executed, respectively.
Can anyone tell me what fundamental problem am I having when referring
to field values in a subform? My inclination would have been to use
exclamation marks in the field path names (i.e.,
Me!NCRListSubForm![NCRID]) instead of a period, but like I say, the
period worked for me in "NCRList".
-- David