MS-Access Subform Reference Rabbit Hole -


i've got subform buried under number of levels , have trouble referencing it.

if call subform i'm trying coursesubform2, on second page of tab control coursetabcontrolpage2, tab control on subform coursesubform1 , subform on main form enrolmainform.

or, tree:

enrolmainform  - coursesubform1     - coursetabcontrolpage2 (<- name of tab page, not whole tab control)        - coursesubform2 

i'm trying record count of what's on display in coursesubform2 , put in .caption property of second page of control tab.

my attempt::

public sub enrolcompaims()      dim enrolcompaims string      enrolcompaims = trim(forms![enrolmainform]![coursesubform1].form![coursesubform2].form.recordsetclone.recordcount)      forms![enrolmainform]![coursesubform1].form![coursetabcontrolpage2].caption = "component aims (" & enrolcompaims & ")"  end sub 

no error occurring above attempt, enrolcompaims equating 0. record i'm testing on has 4 records in subform recordcount being applied to.

fixed.

my referencing fine, calling enrolcomaims() sub routine current event of main form. guess event occurs before records loaded in coursesubform2 subform.

i called enrolcomaims() current event of coursesubform2 , works fine.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -