Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Page Syntax - Help! 1

Status
Not open for further replies.

combs

Programmer
Apr 18, 2002
78
US
I have a form (frmControlPanel) that has a tab control on it with 7 tabs. I'm trying to access the controls on the seventh tab from a module and can't seem to get the syntax right. Any help would be greatly appreciated.
When I request the properties after clicking on my tab control, it has Page:page0 to Page:page6 (depending on what tab is active) Maybe I have messed up the properties and lost the tab control name???

I thought you could access the controls on the tab by:
[Forms]![frmControlPanel]![TabControlName]![Page0].Control

but it's not working...
 
Why not simply this ?
[Forms]![frmControlPanel]!Control

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi
I do not think you need any of the tab control stuff:
Forms![frmControlPanel].ControlName
 
Thanks for the quick reply PHV!

I tried your suggestion and got the same error message, but maybe I didn't explain my entire problem correctly in the first post.
I am trying to loop through some controls on the tab in question and have come up with some code like this:
[Forms]![frmControlPanel]!Pages(6).Controls("lblS" & i).Value = rs.RecordCount

when you suggested your change, I changed it to:
[Forms]![frmControlPanel]!Controls("lblS" & i).Value = rs.RecordCount

The error message says that it can't find the field 'Controls' now...

Any ideas?
 
[Forms]![frmControlPanel]("lblS" & i).Value = rs.RecordCount

If lblSxx is a label, use the Caption property instead of the Value.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Absolutely right! I can't believe it was that easy and I was making such a stupid mistake (but that's not the first time I've gotten those properties cross-wired...).

Thanks for helping me simplify my code and get back on track here. That's why these forums rock!

A star for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top