473,382 Members | 1,369 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,382 software developers and data experts.

Tab Control as a argument

553 512MB
How would i pass the TabControl to a function?

I have a function:
Expand|Select|Wrap|Line Numbers
  1. Public Function processCount(ctrlName As TabControl) As Integer
  2. ....
  3.  
Call :
Expand|Select|Wrap|Line Numbers
  1. processCount( 'I want to pass the Tab Control Name i am interested in')
  2.  
I cant pass it as a String - i get type mismatch error obviously.

I have also tried:
Expand|Select|Wrap|Line Numbers
  1. processCount( TabCt1.Name = [Page 2])
  2.  
But then i get compile error within the function :
"Method or data member not found"

when i do this
Expand|Select|Wrap|Line Numbers
  1. For Each Ctrl In pageName.Controls
  2.  


Help please?
Jul 26 '07 #1
2 1715
missinglinq
3,532 Expert 2GB
Questionit, you've once again posted a question on the Access Articles section! I'll move it over to the Access Forum for you, but please be more careful in the future. Aside from the fact that you're making extra work for the moderators, posting a question to the Articles section means that it's not being seen by most of the members and hence decreasing the chance that you'll get a timely response.

Linq ;0)>
Jul 26 '07 #2
JKing
1,206 Expert 1GB
TabControl and Page are two different things. You're currently trying to pass a page in as a TabControl.

So you can either pass in a tab control to your current function and manipulate the pages through the page index property of the tab control. Your tab control is probably called something like Me.TabCtl0 on your form.

So that would be something like:
Expand|Select|Wrap|Line Numbers
  1. Dim intx as Integer
  2.  
  3. intx = processCount(Me.TabCtl0)
  4.  
Or you can change the Function to take in a page instead of a tabcontrol

Expand|Select|Wrap|Line Numbers
  1. Public Function processCount(ctrl as Page) As Integer
  2. End Function
  3.  
  4. 'call it
  5. intx = processCount(Me.Page2)
  6.  
Jul 26 '07 #3

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

Similar topics

10
by: James McGivney | last post by:
I have a project in ASP.NET using C#. I have a large number of Button Controls and a large number of ImageButton Controls. It would be convienent if I could refer to a specific control by it's...
5
by: Michael | last post by:
Ive been programming for some time now, so i wanted to get into graphics, but i wanted to see if I could make a Picture Viewer. I have no experience with the picture control, ive tryed the MSDN...
9
by: ckerns | last post by:
I want to loop thru an array of controls,(39 of them...defaults = 0). If value is null or non-numeric I want to assign the value of "0". rowString = "L411" //conrol name if (isNaN(eval...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
2
by: rawCoder | last post by:
Hi I am having this InvalidOperationException with message Cannot call Invoke or InvokeAsync on a control until the window handle has been created This is raised when i try to invoke a method...
0
by: paul.phillips | last post by:
Hi, please can someone help me? I have created a custom web control that renders GridView, which it does (e.g. I can see data in the grid). The problem is this, how do I add a Select command...
8
by: bienwell | last post by:
Hi, I have a problem of displaying data bound by a datalist control. In my table, I have a field Start_date which has Short Date data type. I tried to update this field by Current Date. After...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
3
by: Kristian Frost | last post by:
Hi, me again, I'm trying to create a User Control in VS2003 that takes an object as an argument from its parent form and designs itself accordingly. At the moment, I'm having to create a default,...
1
by: Andy | last post by:
Hi, why does with-param fail to send parameters to any templates in a stylesheet that also accepts arguments from the ASP.NET XML control? The argument from the XML control seems to be available...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.