vba - How to cycle between tabs on a tab? -


my access form "frmload" has 5 tabbed pages. 1 of pages has subform "frmclients" few dozen tabbed pages.

i need cycle through each tabbed page on frmclients, debug.print tab name, modify labels, , go on next.

(i don't have access other tabs on frmload; mention in case have qualify everything.)

the documentation i've been reading confusing. i'm not sure of difference between page , tab, 1 thing.

you can reference tab pages frmclients' controls collection.


run in standard module , debug.print needed references.

sub printlabelsreferences()     dim ctrl object, pagectrl object     each ctrl in forms("frmload").controls("frmclients").controls         if typename(ctrl) = "page"             each pagectrl in ctrl.controls                 if typename(pagectrl) = "label"                     debug.print "me.controls(""frmclients"").controls("""; pagectrl.name; """).caption ="""; pagectrl.caption; """"                     debug.print "forms(""frmload"").controls(""frmclients"").controls("""; pagectrl.name; """).caption ="""; pagectrl.caption; """"                 end if             next         end if     next end sub 

uses forms() reference if want modify label.caption outside of form or use me if want reference label.caption within form's code module.

enter image description here enter image description here


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -