Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

IF criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul B. - 11 Jan 2005 16:07 GMT
Can someone tell me if the IF statement will accept something like this:

IF (testnum = 202, 203, 204, 205, 265, 266, 268) Then
  DO THIS
ELSE
  DO THIS

I am looking for an easier way of doing the following:

IF (testnum >= 202) AND (testnum <=205) Then
   DO THIS
ElseIf (testnum >=265) AND (testnum <=268) Then
   DO THIS
Else
  DO THIS

Any ideas are appreciated....

Cheers
Brian - 11 Jan 2005 16:22 GMT
> Can someone tell me if the IF statement will accept something like this:
>
[quoted text clipped - 15 lines]
>
> Cheers

I tend to use Select...Case for something like this:

   Select testnum
       Case  202, 203, 204, 205, 265, 266, 268
           DO THIS
       Case Else
           DO THIS
   End Select
Paul B. - 11 Jan 2005 16:31 GMT
Thanks Brian,

Learning something new everyday.....

> > Can someone tell me if the IF statement will accept something like this:
> >
[quoted text clipped - 24 lines]
>             DO THIS
>     End Select
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.