Anyone knows where I can get more information about nested If statements? The problem I have with mine is it stops at the first If statement and does not proceed to the next.
Select Case ([Sent]) And ([Recvd])
'document sent, not returned
Case Not IsNull([Sent]) And IsNull([Recvd])
Me!imgDocNotReturned.Visible = True
Me!imgDocReturned.Visible = False
'document sent, document returned
Case Not IsNull([Recvd]) And Not IsNull([Sent])
Me!imgDocNotReturned.Visible = False
Me!imgDocReturned.Visible = False
'survey not sent, survey not returned
Case IsNull([Recvd]) And IsNull([Sent])
Me!imgDocNotReturned.Visible = False
Me!imgDocReturned.Visible = False
Case Else
End Select
It keeps stopping in the first case and won't loop to the next for all the recordset. What code shall I add in to loop through instead of stopping at the first case? Thanks in advance.
I think nested IFs (Even If.. ElseIf...ElseIF) is the way to go. I had an instructor that went psycho whenever he saw CASE statements with more than 1 variable and double negatives (Not IsNull) although I agree there is often no way around it. The If..Then, ElseIF...Then will probably read a little cleaner too...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.