Calling A Sub Cont...

  • Thread starter Thread starter James
  • Start date Start date
J

James

I have tried that code that you gave me and well it comes
up with an error
when ever I open the form the error is:

"You entered an expression that requires the form to be
active window."

This I cannot understand as I am opening it as the only
form and I have
tried opening it from a command button that pulls it up?
What could possibly
be going wrong?

Also for some reason its juts NOT locking anything down it
just seems to
ignore everything.

Does it have something to do with I have not
changed "MyForm" from your
code? Do I have to change that for each of my form names?

Many Thanks

James
 
MyForm is the generic name of the form in the code. It represents any form you
run the code on. The specific form it refers to is in the other code I
provided - Call MySub(frmCurrentForm). frmCurrentForm is the name of the current
form and MyForm refers to it. So No, it does not have anything to do with you
not changing "MyForm" in the code and No, you do not have to change that for
each your my form names?

' Dim frmCurrentForm As Form
' Set frmCurrentForm = Screen.ActiveForm
Call MySub("NameOfYourForm")

Try commenting out the first two lines of this code as shown and change the
third line by entering the actual name of your for. The quotes are required!

Steve
PC Datasheet
 
Hello Sorry to be a pain but this is still not working...

Would you like me to send you a copy of what I am trying
to achieve?

I have tried multiple things and I am trying to call
things and still nothing?

Is there anything else I could try?

Many Thanks

James
 
If you want, send it to me and I will take a look at it. Give me explicit
directions as to where the problem is so I don't have to spend a lot of time
looking for the problem. My email address is (e-mail address removed).

Steve
PC Datasheet
 
Back
Top