I am thoroughly perplexed. I am trying to create an unbound control on a subform that will give me the CurrentRecord property for the given line item. I am using the sample code from the Access documentation:
[tt]
function CurrentFormRecord(frm as Form)
dim lngrecordnum as Long
lngrecordnum = frm.CurrentRecord
CurrentFormRecord = lngrecordnum
end function
[/tt]
However, I cannot seem to pass the function a form that it will accept. I've tried passing it "Me" and "[Forms]![sfrmMyForm]", both of which create errors. Screen.ActiveForm will only return me the form enclosing the subform. RunningSum only works in reports.
What do I have to do to pass the CurrentFormRecord function the current subform?
Sincerely, Jonathan
[tt]
function CurrentFormRecord(frm as Form)
dim lngrecordnum as Long
lngrecordnum = frm.CurrentRecord
CurrentFormRecord = lngrecordnum
end function
[/tt]
However, I cannot seem to pass the function a form that it will accept. I've tried passing it "Me" and "[Forms]![sfrmMyForm]", both of which create errors. Screen.ActiveForm will only return me the form enclosing the subform. RunningSum only works in reports.
What do I have to do to pass the CurrentFormRecord function the current subform?
Sincerely, Jonathan