G
Guest
The sample code at the very bottom works, but I have to list each Org Code
using "Or". Is there a way to change the first line of the If statement to
use "Between" or "In"? Such as:
If myRs![Org Code] Between 109011 and 109051 Then...
or
If myRs![Org Code] In ('109011','109021','109031','109041','109051') Then...
---------
sql = "SELECT [Org Code] FROM [Organization]"
Set myDb = CurrentDb()
Set myRs = myDb.OpenRecordset(sql)
While Not myRs.EOF
If myRs![Org Code] = 109011 Or myRs![Org Code] = 109021 Then
Dothis...
EndIf
myRs.MoveNext
Wend
Any suggestions? Thank you!
~notDave
using "Or". Is there a way to change the first line of the If statement to
use "Between" or "In"? Such as:
If myRs![Org Code] Between 109011 and 109051 Then...
or
If myRs![Org Code] In ('109011','109021','109031','109041','109051') Then...
---------
sql = "SELECT [Org Code] FROM [Organization]"
Set myDb = CurrentDb()
Set myRs = myDb.OpenRecordset(sql)
While Not myRs.EOF
If myRs![Org Code] = 109011 Or myRs![Org Code] = 109021 Then
Dothis...
EndIf
myRs.MoveNext
Wend
Any suggestions? Thank you!
~notDave