code not working

M

Moh

why does this code not work? ? ? or what have i missed out??

Private Sub CommandButton3_Click()
If Me.TextBox1.Value = 74987 Then
Worksheets("Bank View1").Activate
Unload Me
Else
MsgBox "Wrong Password Please check Password and Try again"
Me.TextBox1 = ""
Sheets("Instructions").Select
End Sub
 
I

Incidental

Hi Moh

Your code seems to be missing the "end if" just before the end sub to
close the if statement.

Hope this helps

Steve
 
B

Bob Phillips

Does not work? What does it do, trash your PC, disappear up its own ...

There is a misusing End if at the end, but the compiler would tell you that,
so some detail would help.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Moh

you are one funny comedian errrrm not

anyway thank you for the help

much appreciated.

Cheers Ears
--



Bob Phillips said:
Does not work? What does it do, trash your PC, disappear up its own ...

There is a misusing End if at the end, but the compiler would tell you that,
so some detail would help.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

Rick Rothstein \(MVP - VB\)

Bob's point, and something for you to remember for future newsgroup
postings, saying "it does not work" tells us absolutely nothing about your
problem. You have to tell us what you thought was going to happen and what
actually happened instead; then we would have an idea of where to look in
order to help you. Think of it this way... you take your car in to your
service shop and tell the mechanic, "My car doesn't work right"... do you
think he will start right in fixing it, or might he want to know a little
more information first. We need additional information over and above "it
doesn't work" in the same way your mechanic would.

By the way, you didn't mention whether the missing "End If" was your problem
or not.

Rick


Moh said:
you are one funny comedian errrrm not

anyway thank you for the help

much appreciated.

Cheers Ears
 

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