hi,
We post number of days in the text box based on which from date and to date are displayed. From Date is by default the system date. The report needs to generate columns based on the no of days posted in the text box. But I am getting error while adding date at runtime to mshflexgrid header column.
It is generating the columns but the last column is generating an error
Can anybody help me to resolve this please.
Thank you very much..
Prerana
the error is : Exception from HRESULT: 0x800A017D (CTL_E_INVALIDPROPERTYARRAYINDEX)
this error is displaying at the last time of loop.
The following is the code:
If i = 3 Then
fdate = DateTimePicker1.Value.ToString("MM/dd/yyyy HH:mm:ss tt")
sdate = DateTimePicker1.Value.ToString("dd-MM-yyyy")
.set_TextMatrix(0, i, sdate)
ElseIf i > 3 And i < 34 Then
If rbtDaily.Checked = True Then
j = 1
ndate = (Now.AddDays(j).ToString("MM/dd/yyyy HH:mm:ss tt"))
sdate = Now.AddDays(j).ToString("dd-MM-yyyy")
error at this line: .set_TextMatrix(0, i, sdate)
ElseIf rbtWeekly.Checked = True Then
ndate = DateValue(Now.AddDays(6).ToString("MM/dd/yyyy HH:mm:ss tt"))
sdate = Now.AddDays(6).ToString("dd-MM-yyyy")
.set_TextMatrix(0, i, sdate)
ElseIf rbtMonthly.Checked = True Then
j = 1
ndate = DateValue(Now.AddMonths(j).ToString("MM/dd/yyyy HH:mm:ss tt"))
sdate = Now.AddDays(j).ToString("dd-MM-yyyy")
.set_TextMatrix(0, i, sdate)
End If