Solved

Passing A Textbox Control Array To A Function

Posted on 2004-10-17
3
188 Views
Last Modified: 2010-05-02
I have a textbox control array.

I'd like to pass it to my function. There, it would create another instance of that textbox and do some work on it.
I have tried the following code, but get the error: "Type mismatch: array or user-defined type expected"

Call formatText(Text1(0))

Private Function formatText(Txt() As TextBox)
'do some work on the Txt() control
End Function

Any Suggestions? Many Thanks.
A. Tucker
0
Comment
Question by:A_Tucker
3 Comments
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 12333717
Change:
Private Function formatText(Txt() As TextBox)
To

Private Function formatText(TmpTxt As TextBox)
' No () in the control name
0
 

Author Comment

by:A_Tucker
ID: 12334430
easy when u know how! thanks!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12334445
The code hes posted will only work if you want to pass one member of the Text1 control array.  If you want to pass the entire array, then the array need to be passed as an object or a variant.  Something like:

Private Function formatText(Txt as Object)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now