Connecting Tech Pros Worldwide Forums | Help | Site Map

Setting focus on reports ?

David
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi,

I am trying to do something really simple, but am not quite sure how
to.

If I have 2 text boxes on a report and I wish to hide one dependent on
what the other is showing.

i.e, Text Box 1 shows "Fred", Text Box 2 shows "Apples"

If text1 shows "Fred" then display text2, else hide text2.

Normally you need to set focus to the object you are testing against,
but you cannot do that on reports ?


Thanks in advance


David

Salad
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Setting focus on reports ?


David wrote:
[color=blue]
> Hi,
>
> I am trying to do something really simple, but am not quite sure how
> to.
>
> If I have 2 text boxes on a report and I wish to hide one dependent on
> what the other is showing.
>
> i.e, Text Box 1 shows "Fred", Text Box 2 shows "Apples"
>
> If text1 shows "Fred" then display text2, else hide text2.
>
> Normally you need to set focus to the object you are testing against,
> but you cannot do that on reports ?
>
>
> Thanks in advance
>
>
> David[/color]

I testing this out. I have 2 fields in a report; Code and Description.
Code is numeric. I decided to hide all code numbers if the last digit
was 0. I dbl-Clicked on Detail and entered the code in the OnFormat event

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Right(Code, 1) <> 0 Then
Me.Description.Visible = True
Else
Me.Description.Visible = False
End If
End Sub

Closed Thread


Similar Microsoft Access / VBA bytes