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

Number of tabs based on number of records. 1

Status
Not open for further replies.

gemoon

Programmer
Mar 22, 2002
55
US
Im not sure if what I am trying to do can be done?

I am trying to create a form to ease data entry.

I have a database that has information organized by date. In the database there is information for each date. One bit of information is an item with its associated data. Depending upon the date there can be 1, 2, 3 or more items.

I would like to create a from that has a tab control. For each item, I would like have an individual tab. If there is only one item, I would like to have one tab. If there are two items, then I would like to to have two tabs. And so forth.

Does anyone know if this is possible and if so what is this called and how would I go about setting it up?

Many thanks,
Ed.
 
Ed

This would be pretty tough, and I guess the question what are you going to do if you have a thousand dates? Easy data entry may become a tad more complicated.

If you know ahead of time that you will have a minimal amount of dates, you could design a multitab form with enough tabs.

Then, you can decide for each record...
- how many tabs do you need
- set the recordset for each tab and make the tab visible
- hide tabs not being used.

...But I am concerned about why you need this design. You know your data, your needs and your customer which may suggest that this is the best approach. But when I see this type of thing, along with "not enough fields in a table", I start to think about design issues.

Consider reading the following documentation...
or

Richard
 
How are ya gemoon . . . . .

Lets say you could do that. Problem is, once you have enough items to start a second row or more in the tab control, y[blue]our gonna have to start shifting positions of the controls to maintain relative positions with the tabs[/blue] . . . . Have you thought about this (its alot of work)?

Out of curiosity . . . . why would you want to do this?

Calvin.gif
See Ya! . . . . . .
 
Either this is way more complicated than I thought or I have done a poor job of explaining the problem. I think its probably a combination of both.

The database I have is fairly simple. It is as follows:

tblDate:
Date
field1
field2
field3
DateID

relationship- 1:many via DateID

tblReplicate:
DateID
Replicate
ReplicateID

relationship- 1:many via ReplicateID

tblSamples:
ReplicateID
SampleID

tblSamples is linked to several other tables that contain data. These data are linked through SampleID

I could (and did) set up a form that has date and fields1, 2 and 3. There is a subform to navigate through the replicates with their associated sample data.

I have been asked if it is possible for the records in the subform to be displayed as a series of tabs rather than using the navigation bar/buttons. Generally there will be replicates 1, 2 and 3. At a maximum, there will be 5.

As far as why?
The users would prefer a set of tabs. The thought is that when you are navigating through dates, you can quickly see how many replicates there are and what replicate you are viewing by the tab display. The concensus is that tabs are more recognizable than the numbers on the navigation bar. Added visual recognision will result in a reduction in the chance of editing errors.

So. If its possible (without a massive amount of work), I will do it. If its not possible (or is too time consuming), it wont be done.

Does this all make sense?
Thanks very much for the feedback.
Ed.


 
I have been asked if it is possible for the records in the subform to be displayed as a series of tabs

As I understand it, this requires...
- Determine how many records a related to the tblDate master record.
- Programatically, open each tab / subform with the subsequent record.

Yes, I can see how this can be done, and my initial thoughts is that it would require a lot of work.
- It is far easy to hard code X number of tabs and hide or unhide tabs as required. To programatically, with my knowledge of VBA, add and delete tabs would be tough.
- Determining the number records to display - easy. the MAX 5 is good news. But if there are a lot of records, you will run out of the number of hard coded tabs, or develope a procedure to dynamically add / delete tabs.
- Open each tab with the sequential corresponding date and associated record - moderate difficulty, several approaches.

Another approach
when you are navigating through dates, you can quickly see how many replicates there are and what replicate you are viewing by the tab display

Create a small, contineous / tabular subform on the left side under the main form. This subform would depict a very brief description of the record - just the date, or date + replica. To the right, is another subform based on the same table, but is setup as a single form.

The end user clicks on a date on the contineous subform on the left - the corresponding form appears on the right subform.

[tt]
+----------+ +----------------------+
|01-Jan-04 | |15-Jan-04 |
|15-Jan-04X| <-Select |Replica #2 |
|02-Feb-04 | |bla bla bla bla bla|
+----------+ +----------------------+
[/tt]
This type of design would be very easy to code.

Richard
 
I can see that the tabs idea is definitely a bad idea. Richard's suggestion of using linked subforms with one being continuous seems like an ideal solution.

Thanks!
Ed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top