Hi guys,
I'm sure one of you wizards will be able to let me know what i'm doing wrong!
Basically, i'm trying to populate certain start dates, based upon which date is populated and whether the F flag is set to true.
The section of code below is part of a larger if statement (propbably not the most efficient piece of code, but it is all i know)
To give you a further bit of background i am comparing 2 recordsets (rs and rs2) against each other, based upon the differences (M number for example) then the code decides on whether to populate the Effective From Date with either the historic Eff from Date of the Transco Start Date ( Based on whichever is not null)
When the code is as above it highlights the SELECT statement down to the IF line as red, so this obviously is incorrect. If i put underscores after the THENs, then this looks ok, but then errors on exectution at the ELSEIF line, stating that "Else Without If".
I'm hoping that i have explained myself ok. I sure that there is quite a simple answer, even if it is that you cannot have an IF statement nested as part of a SELECT statement.
Look forward to hearing from you guys.
OOch
I'm sure one of you wizards will be able to let me know what i'm doing wrong!
Basically, i'm trying to populate certain start dates, based upon which date is populated and whether the F flag is set to true.
The section of code below is part of a larger if statement (propbably not the most efficient piece of code, but it is all i know)
To give you a further bit of background i am comparing 2 recordsets (rs and rs2) against each other, based upon the differences (M number for example) then the code decides on whether to populate the Effective From Date with either the historic Eff from Date of the Transco Start Date ( Based on whichever is not null)
Code:
ElseIf (M = M2 And ((rs.AbsolutePosition + 1) = rsEnd) And E2 = "00:00:00") Then
Select Case F: _
Case Is = True: _
rs2.Fields("effective from date")
= Edt: rs2.Update: rs2.MoveLast: _
[b][COLOR=red] Case Is = False: _
If rs![Effective From Date].Value
<> "00:00:00" Then
rs2.Fields("effective from date")
= rs![Effective From Date].Value
ElseIf rs![Effective From Date].Value
= "00:00:00" Then
rs2.Fields("effective from date") = rs!
[Transco Start Date].Value:[/color][/b]
rs2.Update: rs2.MoveLast: _
End Select
When the code is as above it highlights the SELECT statement down to the IF line as red, so this obviously is incorrect. If i put underscores after the THENs, then this looks ok, but then errors on exectution at the ELSEIF line, stating that "Else Without If".
I'm hoping that i have explained myself ok. I sure that there is quite a simple answer, even if it is that you cannot have an IF statement nested as part of a SELECT statement.
Look forward to hearing from you guys.
OOch