Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access XP Report - programmatically remove field from inside address

Posted on 2011-09-21
3
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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