Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to reference fields on a TabControl's page
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
How to reference fields on a TabControl's page
Divers
Thread ID:
00851571
Message ID:
00851571
Vues:
69
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform