Object doesn't support...

D

davegb

this property or method. Message I'm getting when I enter any text
password into the text box which uses this code:

Private Sub cbOK_Click()
sPwrd = ufPwrdEntry.tbPwrdEntry.Value <---Object doesn't support...
If sPwrd = "" Then
MsgBox "Please enter the password to access this worksheet.",
vbOKCancel
End If
End Sub

Just setting a string variable to what was entered into a textbox, I
thought. Any suggestions?

Thanks!
 
D

davegb

I should have mentioned that sPwrd is publicly declared as a string
variable by the routine that calls this one.
 
J

Jim Cone

The code structure works for me.
My guess is that you may have misspelled the textbox or userform name.

However, I don't know how a "routine" can declare a variable as
truly "Public". That has to be done outside of a sub routine at the top
of a standard module.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"davegb"
<[email protected]>
wrote in message
I should have mentioned that sPwrd is publicly declared as a string
variable by the routine that calls this one.
 
D

davegb

Jim said:
The code structure works for me.
My guess is that you may have misspelled the textbox or userform name.

However, I don't know how a "routine" can declare a variable as
truly "Public". That has to be done outside of a sub routine at the top
of a standard module.

Jim, thanks for your reply.

I've checked and rechecked the userform name and the textbox name. I'll
check them once more, but I don't think that's it.

As far as publicly declaring the variable, I should have said, to be
exact, that the variable was publicly declared in the module where the
code that calls the userform resides.

Any other suggestions?
 

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