Solved

report in Access 2003

Posted on 2011-02-11
7
329 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
  • 5
7 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 125 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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 125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

863 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

24 Experts available now in Live!

Get 1:1 Help Now