How to change code to and

tambadal

New Member
Joined
Oct 31, 2019
Messages
10
Code:
Private Sub Command43_Click()
'Admin Button  Bring back nav and other views that are hidden
       
       
If Text9.Value = "tam.badal" Then

'UnHide the hidden objects in the navigation pane
    Application.SetOption "Show Hidden Objects", True
'UnLock navigation pane
    DoCmd.LockNavigationPane False
'Enable right clicks and menus
    CurrentDb.Properties("AllowFullMenus") = True
    CurrentDb.Properties("AllowShortcutMenus") = True
    CurrentDb.Properties("AllowBuiltinToolbars") = True
    DoCmd.ShowToolbar "Ribbon", acToolbarYes
    DoCmd.SelectObject acTable, , True
    
Else
End If
     
End Sub

How do I modify this and statement to say If Text9.Value = "tam.badal" or "Gregory.heyman" Then...
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi & welcome to MrExcel.
Assuming it's the same way as excel try
Code:
If Text9.Value = "tam.badal" Or Text9.Value = "Gregory.heyman" Then
 
Upvote 0
Have you tried:

If Text9.Value = "tam.badal" Or Text9.Value = "Gregory.heyman" Then
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top