?
Solved

report in Access 2003

Posted on 2011-02-11
7
Medium Priority
?
335 Views
Last Modified: 2013-11-28
Is it possible in a report in Access 2003 to have the following condition between 2 controls: 1st control is visible if the 2nd control is not null or empty and 1st control is not visible if the 2nd control is null or empty?
Thank you
0
Comment
Question by:marian68
[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
  • 5
7 Comments
 
LVL 31

Accepted Solution

by:
Helen Feddema earned 500 total points
ID: 34872780
This code should do it:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

   If Nz(Me![Second] <> "" Then
      Me![txtFirst].Visible = True
   Else
      Me![txtFirst].Visible = False
   End If
      
End Sub

Open in new window

0
 

Author Comment

by:marian68
ID: 34872919
Thank you Helen
Where do I have to put this code in my report?
Thank you
0
 

Author Comment

by:marian68
ID: 34873084
In the meantime I found the place for the code.
Please tell me if I add another field what would be the code:
1st control is visible if the 2nd control or the 3rd control is not null or empty and 1st control is not visible if the 2nd control and the 3rd control is null or empty?
Thanks a lot
0
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!

 

Author Comment

by:marian68
ID: 34873181
  If Nz(Me![COMMENTS] <> "" Then
I am receiving a syntax error for this line.
Thank you
0
 

Author Comment

by:marian68
ID: 34873339
I found the syntax error.
Please tell me if I add another field what would be the code:
1st control is visible if the 2nd control or the 3rd control is not null or empty and 1st control is not visible if the 2nd control and the 3rd control is null or empty?
Thanks a lot
0
 

Author Comment

by:marian68
ID: 34874114
Anyone there!
Thank you
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 500 total points
ID: 34897568
<Points to Helen if this is what you need>
(Just trying to help out)
;-)

If Nz(Me![Second]) <> ""  Or Nz(Me![Third])<> "" Then
      Me![txtFirst].Visible = True
   Else
      Me![txtFirst].Visible = False
   End If


JeffCoachman
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 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