C
CJ
Hi Groupies
I don't have any experience with Select Case, I usually use complex IIF
statements. However, in this case, I think Case would be much more
efficient, if I can get this portion below to work.
My issue is that I need to test for more than 1 condition at the same time.
I need to test 2 different dates against 2 other dates but can the Select
Case have an AND statement like this?
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
Dim lblInvalidLabel1 As Label
Dim txtSomething As Single
Select Case txtSomething
Case Me.txtFormStart < Me.dtmStartDate And Me.txtFormEnd > Me.dtmEndDate
Me.txtSomething = 123
Me.lblInvalidLabel1.Visible = True
Case Else
Me.txtSomething = 999
Me.lblInvalidLabel1.Visible = False
End Select
End Sub
In my report, I am getting the first Case result no matter what.
If I can not use AND, how would I need to write this?
I don't have any experience with Select Case, I usually use complex IIF
statements. However, in this case, I think Case would be much more
efficient, if I can get this portion below to work.
My issue is that I need to test for more than 1 condition at the same time.
I need to test 2 different dates against 2 other dates but can the Select
Case have an AND statement like this?
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
Dim lblInvalidLabel1 As Label
Dim txtSomething As Single
Select Case txtSomething
Case Me.txtFormStart < Me.dtmStartDate And Me.txtFormEnd > Me.dtmEndDate
Me.txtSomething = 123
Me.lblInvalidLabel1.Visible = True
Case Else
Me.txtSomething = 999
Me.lblInvalidLabel1.Visible = False
End Select
End Sub
In my report, I am getting the first Case result no matter what.
If I can not use AND, how would I need to write this?