Select Case Help

  • Thread starter Jackson via AccessMonster.com
  • Start date
J

Jackson via AccessMonster.com

Hi,

I'm a bit new to Select Case as in the past I've used If Then Else End If...

I've got a query that has Asset Class, if it is FX, it gets split into query
x and that is emailed away, if not FX it gets split into query Y and that is
emailed away. If no records, nothing should be emailed. Thereby there are 4
cases:

No Records for FX, No Records for all Else, action: send/do nothing
Records for FX, No Records for all Else, action: send FX only
No Records for FX, Records for all Else, action: send all Else only
Recrods for FX, Records for all Else, action: send FX and send all Else

I'm not sure how to go about setting this up in VB though. I have the email
commands sorted, but how do I set this up as cases, I don't know what my
select case should be as I have two domains, one for FX, one for everything
but FX. Dcount I would imagine but I don't know how to split this out...any
help would be appreciated.
 
J

John Spencer

In this situation, a case statement may not be the way to go. Use the IF,
ElseIf, EndIf structure.

If TestA and Test B then
Do X
ElseIF TestA and Not(TestB) then
Do Y
ElseIf Not(TestA) and TestB then
Do Z
ElseI Not(TestA) and Not(TestB) then
Do A
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top