jazminecat
Programmer
Hi, I have a report where each record has an amendgrantawd field set to currency. For the records where that field is $0.00, I would like to set the visible property of that field to false. I have tried the following:
that throws an error that AmendedVal has no value.
taking that out and just using
give me the same error, that me.amendgrantawd has no value
I have also tried
If Me.amendgrantawd.text
which gives me the "you can't reference a property or method for a control unless the control has the focus" error.
If Me.amendgrantawd > 0#
also throws an error.
where am I going wrong here? thanks in advance for your help!
Code:
Private Sub Report_Open(Cancel As Integer)
'make the amendment invisible if it's zero
Dim AmendedVal As Currency
AmendedVal = Me.amendgrantawd
If AmendedVal > 0 Then
Me.amendgrantawd.Visible = True
Else
Me.amendgrantawd.Visible = False
End If
that throws an error that AmendedVal has no value.
taking that out and just using
Code:
If Me.amendgrantawd > 0 Then
Me.amendgrantawd.Visible = True
Else
Me.amendgrantawd.Visible = False
End If
give me the same error, that me.amendgrantawd has no value
I have also tried
If Me.amendgrantawd.text
which gives me the "you can't reference a property or method for a control unless the control has the focus" error.
If Me.amendgrantawd > 0#
also throws an error.
where am I going wrong here? thanks in advance for your help!