making control visible if other is true

bauer

Registered User.
Local time
Today, 16:15
Joined
Aug 23, 2001
Messages
77
I have a report which prints address. Some users have multiple addresses, but they have a preffered address. Only with those that have multiple address, I need to print out only the one that is preffered. The following is what I've done, but it doesn't work:
I first have this in the Report_Open
PersonID = -1, which is a public variable

then, the following is in the detail_Format
--code--
id = [IndividualKey]
'a personal id number
If PersonID = id Then
'if it repeats, then if it's not the prefferd address, make it invisible
If IsNull([PreferredAddress]) Then
[WholeAddress].Visible = False
'other wise show it
Else
[WholeAddress].Visible = True
End If
End If
--code--

and by default, it is visible
Thank you very much in advance
 
How is your table set up?
Can't you base your report on a query?
 
In the Control Source for your text box for the address field, put this code:

=IIf(IsNull([PreferredAddress]),[WholeAddress],[PreferredAddress])

and keep its Visible set to Yes
 
I realized what my problem was, I didn't know at the time that at the begining of each call I needed to put in to make the feilds visible, other wise, it stays at whatever it was before
 

Users who are viewing this thread

Back
Top Bottom