G
Guest
This is similar to discussions already posted in the forum, but I don't
believe any have addressed this specific point (my apologies, however, if it
is being rehashed):
Each record in my report may or may not have text in a field called
"Location." If there is text in this field, I need the record to be counted.
My records appear in random order. I have a label titled "lblFigure" which
I have set to visible when text is visible in the "Location" field, and is
supposed to iterate in each instance of this.
In this way, the first time that there is text in the "Location" field,
there will be a statement saying "Please refer to Figure 1." The next time,
it will say "Please refer to figure 2," and so on.
Initially, it appears that this problem can be solved simply by programming
a counter in one section of the report code (though I'm unsure which one) and
having the counter increment each time this condition is met. My attempts to
do this, however, have been unsuccessful. I tried entering the following
code in the detail section of my report (where lblFigure appears):
If Me.Location <> "" Then
Me.lblImage1.Visible = True
Me.lblImage2.Visible = True
Me.lblFigure.Visible = True
counter = counter + 1
Me.lblFigure.Caption = counter
Else
Me.lblImage1.Visible = False
Me.lblImage2.Visible = False
Me.lblFigure.Visible = False
End If
But counter is erratic and does not increment in a discernible manner.
This seems tricky to me; any light shed on this matter will
be greatly appreciated. I'll go into even further detail if needed.
Joe
believe any have addressed this specific point (my apologies, however, if it
is being rehashed):
Each record in my report may or may not have text in a field called
"Location." If there is text in this field, I need the record to be counted.
My records appear in random order. I have a label titled "lblFigure" which
I have set to visible when text is visible in the "Location" field, and is
supposed to iterate in each instance of this.
In this way, the first time that there is text in the "Location" field,
there will be a statement saying "Please refer to Figure 1." The next time,
it will say "Please refer to figure 2," and so on.
Initially, it appears that this problem can be solved simply by programming
a counter in one section of the report code (though I'm unsure which one) and
having the counter increment each time this condition is met. My attempts to
do this, however, have been unsuccessful. I tried entering the following
code in the detail section of my report (where lblFigure appears):
If Me.Location <> "" Then
Me.lblImage1.Visible = True
Me.lblImage2.Visible = True
Me.lblFigure.Visible = True
counter = counter + 1
Me.lblFigure.Caption = counter
Else
Me.lblImage1.Visible = False
Me.lblImage2.Visible = False
Me.lblFigure.Visible = False
End If
But counter is erratic and does not increment in a discernible manner.
This seems tricky to me; any light shed on this matter will
be greatly appreciated. I'll go into even further detail if needed.
Joe