Link to home
Start Free TrialLog in
Avatar of neelyjer
neelyjerFlag for United States of America

asked on

What is the Not Equal sign for VBA?

Just need to know the not equal to symbol for programming in VBA.

Refering to question - https://www.experts-exchange.com/questions/21899670/Excel-VBA-IF-function-question.html

the next step is to add an else if statement saying if txtUserID and txt UserPW is not equal to .....

THEN

open formError
Avatar of Harisha M G
Harisha M G
Flag of India image

<>
neelyjer, you don't need to have ElseIf, instead, have Else

If(txtUserID = "Manager"...) Then
    ' Do something
ElseIf(txtUserID = "User"...) Then
    ' Do something else
Else
    ' Invalid username/password combination
End If
Avatar of neelyjer

ASKER

I'm a jack@$$....


I meant to ask for the unhide function.

I ALREADY HAVE THENOT EQUAL TO!!!!

RAISING POINTS TO 250
txtUserID <> value AND  txtPassword <> value

--- or ---

not ( txtUserID = value or  txtPassword = value )
txtUserID.Visible = True
Did I understand it properly ? What do you want to unhide ?

If you are asking to close the form after clicking Cancel,

Me.Hide  will do
Harish,

After entering an incorrect username and/or PW a the login for is hidden and a form opens displaying an error message.  After clicking OK on the error message, I am closing the error form - Unload Me - and unhiding the login form.
So, what is your problem ? :P
If you want to hide another form, put the name of that form instead of Me...

fromLogin.Hide
I need to unhide the form that I was hidden after incorrect userID.  How do I unhide the form?
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfection.  I'm not a dentist but I think we could've pulled teeth quicker than that.