D
DVN
I'm trying to create a report using a crosstab query. This
query reports the amount of failures each month for a
period of 1 to 18 months (defined by the user). Since the
user can set the amount of dates they want to see, the
report has to change with it.
I looked here to find an answer and found a code that
would do the trick except I'm running into an error. Here
is the relevent part of the code:
For i = 0 To iFieldCount - 1
If i <= 9 Then
index = "0" & CStr(i)
ElseIf i > 9 Then
index = CStr(i)
End If
With Me("m" & index)
.ControlSource = qdf.Fields(i + 1).Name
.Left = 1500 + (i * iWidthEach)
.Width = iWidthEach
.Visible = True
End With
With Me("Percent of m" & index)
.Caption = qdf.Fields(i + 1).Name<---Error Here
.Left = 1500 + (i * iWidthEach)
.Width = iWidthEach
.Visible = True
End With
With Me("m" & index & " Grand Total Sum")
.Caption = qdf.Fields(i + 1).Name
.Left = 1500 + (i * iWidthEach)
.Width = iWidthEach
.Visible = True
End With
Next
When the program hits the ".Caption = ..." line, I get a
438 Run-time error, Object doesn't support this property
of method.
Does anybody know what this means and how to fix it?
query reports the amount of failures each month for a
period of 1 to 18 months (defined by the user). Since the
user can set the amount of dates they want to see, the
report has to change with it.
I looked here to find an answer and found a code that
would do the trick except I'm running into an error. Here
is the relevent part of the code:
For i = 0 To iFieldCount - 1
If i <= 9 Then
index = "0" & CStr(i)
ElseIf i > 9 Then
index = CStr(i)
End If
With Me("m" & index)
.ControlSource = qdf.Fields(i + 1).Name
.Left = 1500 + (i * iWidthEach)
.Width = iWidthEach
.Visible = True
End With
With Me("Percent of m" & index)
.Caption = qdf.Fields(i + 1).Name<---Error Here
.Left = 1500 + (i * iWidthEach)
.Width = iWidthEach
.Visible = True
End With
With Me("m" & index & " Grand Total Sum")
.Caption = qdf.Fields(i + 1).Name
.Left = 1500 + (i * iWidthEach)
.Width = iWidthEach
.Visible = True
End With
Next
When the program hits the ".Caption = ..." line, I get a
438 Run-time error, Object doesn't support this property
of method.
Does anybody know what this means and how to fix it?