?
Solved

Using the In or NOT In Clause with VBA Code Question??

Posted on 2010-01-05
3
Medium Priority
?
336 Views
Last Modified: 2012-05-08
Can the In or Not In clause be used directly in VBA code as shown below or should the IF or Select Case be used here.

If Me.DOCUMENT_NUMBER In(110, 112, 113, 117,119) Then
 'Do Something
End If

Thanks,
ET
0
Comment
Question by:Eric Sherman
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 26186834
use the select case

select case me..DOCUMENT_NUMBER
    case  110, 112, 113, 117,119
              'do something
    case else

end select
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 26186941
Ahhhh ... Thanks capricorn1 ...  I don't use the Select Case very often and I kind of figured there was a way to specify multiples on the case line which is pretty much the same as the In clause.

ET
0
 
LVL 19

Author Closing Comment

by:Eric Sherman
ID: 31673274
Thanks!!!  
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question