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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify Tab control during execution

Status
Not open for further replies.

4N6Mstr

Technical User
Oct 6, 2008
40
US
Hello all! Happy Holidays!

This is the situation: In an access database, Managers (high-level users) select products and subparts of that product during the "configuration" phase. This is done for each different project. In other words, the final selection of Products and subparts is different for each project.

In the subsequent phase Supervisors and workers will perform classifications en create reports on those products and subparts. The design asks that products be organized in a Tab Control structure and subparts to be buttons inside each respective tab.

Because each project entails a different combination of Products and Subparts, the Tab Control and buttons have to be changed accordingly. Ideally, that would be automated based on the selections made by the Managers at the beginning of the project.

The real question is: can Tab Controls and elements inside each page be altered by code during runtime? If possible, I’d prefer not to resort to hide / show Pages and Buttons, but actually create them through code after the managers selection is complete.

If that can’t be done, I probably will have to resort to a switchboard-like structure; which have its own limitations.

Tips / Ideas / Suggestions are all welcome!!!


Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
Yes you can build controls and form dynamically, but I would never support this idea. If you need to do this, usually there is an underlying problem with your database structure. If the database is properly organized you should be adding records not fields or controls. So with that said, explain to us the tables in use, relevant fields, and the relationship between the tables.

Normally for this type of organization

Project A
Product 1
Part 1
Part 2
Product 2
Part 1
Part 2
Project B
...

I use a treeview control or synchronized subforms
 
How are ya 4N6Mstr . . .

Agree with [blue]MajP[/blue]. An alternate table structure would be:

[tt]tblProjects
***********

ProjectID PrimaryKey & Parent to tblProducts.ProjectID
prjName


tblProducts
***********

ProductID PrimaryKey & Parent to tblParts.ProductID
ProjectID
ProductNo

tblParts
********

PartID PrimaryKey
ProductID ForeignKey to tblProducts.ProductID
PartNo[/tt]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
MajP,

I understand your concern that the database design might be to blame. That is certainly true in many cases; however, I am not sure if this is the case with my problem.

These are the tables that are pertinent to my question.

Products Table
Prod_Pkey
| Prod_in_Use (bool)
| Other Fields...
|
|
|
|
| Table Parts
| Parts_PKey
|--->Prod_FKey
| Other Fields...
|
|
|
| Table Assembly Methods
| Parts_PKey
|--->Prod_FKey
| Other Fields...


Parts and Assembly Methods relate loosely to each other, but not enough to create a relationship. Both are strongly related to Products, thus the foreign key.

I would agree that a tree with form sub forms would be the best way to tackle the problem. However; Managers can add new products / remove old products for each project (configuration case). You can say that, at this phase, this database is just an “empty canvas” for the real project.

Because I do not know beforehand what products will be featured in a project and also the request from the users on how to access Products / Parts / Assembly Methods during utilization, I decided to go with the dynamic construction of the form that will be driving the project: a Tab Control where the pages will be the products’ names, and buttons for Parts / Methods in each page. Each button will then open other forms where the information about Parts and Methods will be effectively entered.

But, please, don’t get me wrong if you have better ideas I am all ears.


Thank you,


Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
The AceMan,

I do have that "projects" table, although I failed to mention that in my post to MajP. It is just a link table that i was planning to use as the base for the Tab control construction that I referenced in my question.

Again, my problem is how to construct a structure of forms for Products / Parts / Methods, while attending the users' request, not knowing how many products will be in play.

Pls, look at my post to MajP, and keep the suggestions comming.

Thank you.

Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top