Syntax to pass a control as a parameter

rockman

Senior Member
Local time
Today, 15:47
Joined
May 29, 2002
Messages
190
What is the correct syntax to pass a control as a parameter?

For Example:

Private Sub ChangeEnabled(Generic as Textbox)
Generic.Enabled = not(myTextbox.Enabled)
End Sub

Private Sub Main
Call ChangeEnabled(Me!myTextbox) 'This doesn't work
End Sub
 
Try using Screen.ActiveControl.Enabled =
 
Thanks for the reply.

Turns out the problem was with the type of control that I was passing (MSFlexGrid).

I changed the parameter list to "Generic as Control" and it is working fine now.

Jeff
 

Users who are viewing this thread

Back
Top Bottom