Writing a Sub with arguments

G

Guest

Hi. I need a routine which can make 3 controls invisible. To do this, I
have written a Public Sub which takes three arguments. I placed the Public
Sub in a seperate module. When that didnt work, I put it in the Form_load
event, to no avail. it is now back in the module.
The code is:


Sub MakeInvisible(Visiblee1 as object, Visiblee2 as object, Visiblee3 as
object)
Screen.ActiveForm!Visiblee1.Visible = False
Screen.ActiveForm!Visiblee2.Visible = False
Screen.ActiveForm!Visiblee3.Visible = False
End Sub

Then, I write in my command button's DblClick Event,
Call MakeInvisible(Text259, Box481, Text482)

But every time I do this, it tells me "Access could not find 'Visiblee1'" or
a message to that effect. It appears that, for some reason, my arguments are
not passing.
Anyone know what to do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top