?
Solved

Passing A Textbox Control Array To A Function

Posted on 2004-10-17
3
Medium Priority
?
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Accepted Solution

by:
hes earned 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

801 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