G
Gerry
Hello
Descprition of situation:
As you can see here we have a loop (While not ... Wend) which contains
2 'case conditions'.
What is my problem. At the end of this piece of code there is more
code that prepares a mail containing all constatations.
My problem:
In case none of the 'case criteria' match I want to end the procedure
preliminary so the mail doesn't have to be sent.
Can anybody tell me how I have to proceed? Thanks a lot!
<check of files in a Recordset>
nomb = Rs1.RecordCount
Rs1.MoveFirst
While Not (Rs1.EOF)
resultstr = ""
Posnr = Rs1.Fields("Position")
Instrnr = Rs1.Fields("INSTRUMENT")
Select Case Abs(Rs1.Fields("Position"))
Case 5 To 10
resultstr = Instrnr & ":" & Posnr & "EUR"
MsgBox ("Nobody ")
Case 11 To 20
resultstr = resultstr & Instrnr & ":" & Posnr & "EUR"
MsgBox ("Go for It")
End Select
Rs1.MoveNext
Wend
MsgBox ("All Positions checked!")
..... ?? ..... If the criteria don't match, the mail that is generated
hereafter doesn't have to be sent.
<code which creates a general mail containing constatations even if
there is nothing relevant to mention>
Descprition of situation:
As you can see here we have a loop (While not ... Wend) which contains
2 'case conditions'.
What is my problem. At the end of this piece of code there is more
code that prepares a mail containing all constatations.
My problem:
In case none of the 'case criteria' match I want to end the procedure
preliminary so the mail doesn't have to be sent.
Can anybody tell me how I have to proceed? Thanks a lot!
<check of files in a Recordset>
nomb = Rs1.RecordCount
Rs1.MoveFirst
While Not (Rs1.EOF)
resultstr = ""
Posnr = Rs1.Fields("Position")
Instrnr = Rs1.Fields("INSTRUMENT")
Select Case Abs(Rs1.Fields("Position"))
Case 5 To 10
resultstr = Instrnr & ":" & Posnr & "EUR"
MsgBox ("Nobody ")
Case 11 To 20
resultstr = resultstr & Instrnr & ":" & Posnr & "EUR"
MsgBox ("Go for It")
End Select
Rs1.MoveNext
Wend
MsgBox ("All Positions checked!")
..... ?? ..... If the criteria don't match, the mail that is generated
hereafter doesn't have to be sent.
<code which creates a general mail containing constatations even if
there is nothing relevant to mention>