Solved

Access XP Report - programmatically remove field from inside address

Posted on 2011-09-21
3
214 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

685 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