473,385 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Same control on multiple tab pages

doma23
107 100+
Hi,

I have a tab control with couple of pages on it, like:
InfoPage, Page1, Page2, Page3.

On each page there are various text boxes and combo boxes.
What I need to do is to make one of these comboboxes (i.e. cboPeriod1) to be on Page1, Page2 and Page3, but not on the InfoPage.
The problem is that the control needs to be exactly the same.
This is simplified - actually I have 5 comboboxes and 10 reactangles, for which the VBA code already exist. And these 15 controls need to be on 4 different pages. And I would like to avoid puting additional 45 same controls with different name, as that would mean adding much more VBA code to do the same thing with each of these controls.

Is this possible?
Tnx.
Sep 9 '10 #1

✓ answered by ADezii

There is a little trickery that you can use to accomplish what you are requesting:
  1. Create a Combo Box on your Form 'outside' of the Tab Control.
  2. Drag-N-drop the Combo Box along with the associated Label into any Page of the Tab Control.
  3. Position it precisely on the Page and Rename it cboPeriod1.
  4. Set any other Properties of the Combo Box as required.
  5. The Control will now appear on every Page of the Tab Control.
  6. Write Code in the Tab Control's Change() Event to display the Combo Box for every Page except the one titled InfoPage.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub TabCtl0_Change()
    2.  'In my Test Database, the Value of the InfoPage Tab is 2, but it may not
    3.  'be the same in your scenario
    4.  Me![cboPeriod1].Visible = Me![TabCtl0].Value <> 2
    5. End Sub

3 5752
ADezii
8,834 Expert 8TB
There is a little trickery that you can use to accomplish what you are requesting:
  1. Create a Combo Box on your Form 'outside' of the Tab Control.
  2. Drag-N-drop the Combo Box along with the associated Label into any Page of the Tab Control.
  3. Position it precisely on the Page and Rename it cboPeriod1.
  4. Set any other Properties of the Combo Box as required.
  5. The Control will now appear on every Page of the Tab Control.
  6. Write Code in the Tab Control's Change() Event to display the Combo Box for every Page except the one titled InfoPage.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub TabCtl0_Change()
    2.  'In my Test Database, the Value of the InfoPage Tab is 2, but it may not
    3.  'be the same in your scenario
    4.  Me![cboPeriod1].Visible = Me![TabCtl0].Value <> 2
    5. End Sub
Sep 9 '10 #2
doma23
107 100+
Hi ADezii,

Yesterday, I've thought that it probably isn't possible, so I've just put the specific controls outside the tab control, and I came to conclusion that it even has some advantages if it's outside the tab control.
So, I haven't test your solution yet, I might maybe in later stages of development.
I was very suprised to find out that the solution actually exist. Thank you!
Sep 10 '10 #3
ADezii
8,834 Expert 8TB
You are welcome. It technically is not a solution in that the same Control, a single Control, can exist on all but one Page of a Tab Control, but I feel as though it is a viable work around.
Sep 10 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dan.roffman | last post by:
Is there a way to span a report over multiple pages. I think you could do something like count the number of lines and if it exceeds a certain number, then put the rest of th text into another RTF...
1
by: matt | last post by:
I'm using this to scan Multiple pages into Access 2k :- Call KillTempFile strTempFile = TempFile(False, "scan") Me.scanControl.MultiPage = True Me.scanControl.ScanTo = FileOnly...
0
by: ghadley_00 | last post by:
MS Access Create form / report with multiple pages using different background images Hi, Would like to have users fill out a multipage form, and then click a print button, which pulls up the...
1
by: Novice | last post by:
Hey all, I have finally managed to create a Custom WebControl and am using a technique from another programmer to maintain state between pages - I would just like to validate this idea. ...
4
by: tshad | last post by:
Can I set up multiple pages in the same Location tag? I thought I saw somewhere that I could. I tried the following, but it doesn't work. ***************************************************...
2
by: ray well | last post by:
hi, i need to print multiple pages on a printer. this is what i'm using now Sub Print() Dim PrintDoc As New PrintDocument AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText Do While...
0
by: DXJas | last post by:
If I have a gridview control in a web page and it has multiple pages of records. How do I allow the user to print the multiple pages? -- Jas
1
by: anna_john | last post by:
How do i link to multiple pages using the same link? i would like to get an answer related to jsp or javascript
2
by: Matthew Kitchin \(Usenet/Lists\) | last post by:
Hello, I've got multiple pages on the same server that all have the same drop down boxes in them. It is a list of all our facilities. Every time there is a change, I have to change it on every...
0
by: raj3109 | last post by:
Hi experts, I’d like to have some helps from you guys. I need to create an app with C# and Crystal Report.Net using VS 2008 for a Landscape & Nursery company. The company will send out coupon...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.