K
klp via AccessMonster.com
I am using an If..then...elseif statement in the VB editor to determine what
report to print. I am having a problem with the >= And <= part of my
statement. Here is my statement: When I run this statement it will highlight
the <= part of my statement giving me a complie error of Expected:
expression. I have used this before, so I thought and never had any problems.
Not sure what's going on here. Any help appreciated.
If Me.lstTestLabel.Column(0) <= 2002.11 Then
DoCmd.OpenReport "2002 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) >= 2003.01 AND <= 2003.25 Then
DoCmd.OpenReport "2003 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) >= 2004.01 And <= 2004.20 Then
DoCmd.OpenReport "2004 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) >= 2005.01 And <= 2005.29 Then
DoCmd.OpenReport "2005 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) > 2006.01 Then
DoCmd.OpenReport "Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
End If
report to print. I am having a problem with the >= And <= part of my
statement. Here is my statement: When I run this statement it will highlight
the <= part of my statement giving me a complie error of Expected:
expression. I have used this before, so I thought and never had any problems.
Not sure what's going on here. Any help appreciated.
If Me.lstTestLabel.Column(0) <= 2002.11 Then
DoCmd.OpenReport "2002 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) >= 2003.01 AND <= 2003.25 Then
DoCmd.OpenReport "2003 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) >= 2004.01 And <= 2004.20 Then
DoCmd.OpenReport "2004 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) >= 2005.01 And <= 2005.29 Then
DoCmd.OpenReport "2005 Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
ElseIf Me.lstTestLabel.Column(0) > 2006.01 Then
DoCmd.OpenReport "Testing Results by Test", acViewPreview,
WhereCondition:=strWhere
DoCmd.close acForm, "Report Dialog by Test"
End If