Link to home
Start Free TrialLog in
Avatar of rnhoepp
rnhoepp

asked on

Access XP Report - programmatically remove field from inside address

The inside address in this report has a textbox control called ParentOrganizationName and a textbox control ApplicantName. The data in these two controls may be the same or different.

When the data in the two fields is the same, I need to display only the ParentOrganizationName, collapse (?) the ApplicantName control so that it disappears for that report, and move the controls in the inside address together to leave no gaps in the inside address.

Thank you,
Ron
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try this

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
me.ApplicantName.visible= me.ParentOrganizationName<> me.ApplicantName
End Sub
Avatar of rnhoepp
rnhoepp

ASKER

Hi fyed,

You helped me turn the corner on this one. I'd tried working in the query, but keeping the fields separate, then attempting to format in the report...but no luck.

So I tested what you sent me, and it worked! However, I wanted the two names in separate lines if the organization and applicant were different names.

This is how I changed it:

OrganizationOrApplicant: [ParentOrganizationName] & IIf([ParentOrganizationName]=[ApplicantName],"",Chr(13) & Chr(10) & [ApplicantName])

Thank you so much. And thanks to Capricorn1 for your submission.

Regards,
Ron