Solved

Access XP Report - programmatically remove field from inside address

Posted on 2011-09-21
3
210 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:rnhoepp
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 36575773
How are you displaying these now ?  Two separate fields?

You could combine them in the query that is the RecordSource for your report, something like:

FieldName: [ParentOrganizationName] & IIF([ParentOrganizationName] = [ApplicantName], "", " (" & [ApplicantName] & ")")

Then you would only need one field, and it would contain both values if these fields were different.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 36575790
try this

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

Author Closing Comment

by:rnhoepp
ID: 36576917
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
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now