Hi i have the day of the week as check boxes on a form, if the user enables teh check boxes they all days of weeks have values (but the user can change the values for each day) Its Either all weekdays have value or none of them. Below is what i wrote to set the price attributes and increment the days, Is there a more effecient way to accomplish what i have: (Thanks)
Code:
If Not IsNull(objRS("Sun")) Then
dblTempPrice = CDbl(objRS("Sun"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(objRS("RateStartDate")) & """ stop=""" & GDSdates(objRS("RateEndDate")) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
varNewRateStartDate = objRS("RateEndDate")
varNewRateEndDate = DateAdd("d",1,varNewRateStartDate)
dblTempPrice = CDbl(objRS("Mon"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """ xperson=""" & objRS("ExtraCharge2") & """/>")
varNewRateStartDate = varNewRateEndDate
varNewRateEndDate = DateAdd("d",1,varRateStartDate)
dblTempPrice = CDbl(objRS("Tue"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
varNewRateStartDate = varNewRateEndDate
varNewRateEndDate = DateAdd("d",1,varRateStartDate)
dblTempPrice = CDbl(objRS("Wed"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
varNewRateStartDate = varNewRateEndDate
varNewRateEndDate = DateAdd("d",1,varRateStartDate)
dblTempPrice = CDbl(objRS("Thu"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
varNewRateStartDate = varNewRateEndDate
varNewRateEndDate = DateAdd("d",1,varRateStartDate)
dblTempPrice = CDbl(objRS("Fri"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
varNewRateStartDate = varNewRateEndDate
varNewRateEndDate = DateAdd("d",1,varRateStartDate)
dblTempPrice = CDbl(objRS("Sat"))
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
Else
rateNode = rateNode & encodeXML("<rate start=""" & GDSdates(varNewRateStartDate) & """ stop=""" & GDSdates(varNewRateEndDate) & """ price=""" & FormatCurrency(dblTempPrice,2) & """/>")
End If