Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reference fields on a TabControl's page
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
How to reference fields on a TabControl's page
Miscellaneous
Thread ID:
00851571
Message ID:
00851571
Views:
70
I need to find out how to access/reference fields on a TabControl's page

Here's a description of what I have and how far I've gotten...

I have a form
The form is named frmOmnia_Act_Top
The form has two halves
The top half has a variety of fields on it, like txtCompany
The bottom half of the form is my Tab Control which is named tcBottom.
This has several pages on it. One of the pages is named tpUserFields.
tpUserFields has a field on it named txtRep

In my form's load I connect to my data, and call a procdure I call
ShowRecord(intCurrentRecord)

In ShowRecord I initialize my fields as follows
txtCompany.Text = dstOmnia_Act.Tables(0).Rows(intCurrentRecord).Item("Company")

I can now initialize the fields on the Tab Control as follows
Me.Controls.Item(2).Controls.Item(3).Controls.Item(8).Text = dstOmnia_Act.Table(0).Rows(intCurrentRecord).Item("Rep")

While this works, it's not maintainable...and it's confusing.
The only way I got this far was via the debugger...

BTW - the "Rep" field is the first field on the tab page.
There's a txtComments field also...It's the last field on the page
to reference the "Comments" field I would have to use the following line
Me.Controls.Item(2).Controls.Item(3).Controls.Item(1).Text = dstOmnia_Act.Table(0).Rows(intCurrentRecord).Item("Comments")

I know there's a better way than what I've stumbled upon.
How am I supposed to reference these fields?

TIA

Rick
Next
Reply
Map
View

Click here to load this message in the networking platform