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

Passing a checkbox array to subroutine and scrolling form

Status
Not open for further replies.

jpspring

Programmer
Oct 6, 2000
25
GB
I wonder if it is possible to send a control array to a subroutine. and how can you make a standard form scrollable.
 
I pass textbox control arrays to a "clear text" sub routine all the time. Try this sub:

Public Sub ClearTextInArray(ParamArray TheControls() As Variant)
'rmg
'this routine will only work with text boxes that have been set up in an array
On Error Resume Next
Dim MyTextSource As Variant
For Each MyTextSource In TheControls
MyTextSource.Text = ""
Next MyTextSource

End Sub

To use it:

Call ClearTextInArray("txtCustInfo", Me)

Substitute txtCustInfo for your textbox array name. I've used this same type of code for other control arrays as well. (NOTE: When useing ParamArray you MUST declare it as a Variant)

I hope this is what you meant by your question.

As far as scrolling forms, I've seen numberous examples of code to do this. I've never tried any of it. Take a stroll through - you can probably find something there to fit the bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top