Solved

report in Access 2003

Posted on 2011-02-11
3
300 Views
Last Modified: 2013-11-28
Is it possible in a report in Access 2003 to have the following condition between 3 controls:
1st control is visible if the 2nd control or the 3rd control are not null or empty and 1st control is not visible if the 2nd control and the 3rd control are null or empty?
Thanks a lot
0
Comment
Question by:marian68
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 34874914
You can likely use the Format or Print event of the section hosting those controls (i.e. the Details section, for example), and do something like this:

Me.Control1.Visible = Nz(Me.Control2, 0) <>0 OR Nz(Me.Control3,0) <>)

0
 
LVL 31

Assisted Solution

by:Helen_Feddema
Helen_Feddema earned 125 total points
ID: 34874991
I think I already answered a similar question.  Here is the code with another condition for the 3rd control:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

   If Nz(Me![LastName]) <> "" Or Nz(Me![FirstName]) <> "" Then
      Me![txtSSN].Visible = True
   ElseIf Nz(Me![LastName]) = "" And Nz(Me![FirstName]) = "" Then
      Me![txtSSN].Visible = False
   End If
      
End Sub

Open in new window

0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 34874999
Note that this works in Print Preview, but not in Report view.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dsum Function for List Box Data 7 48
How can you open the FORM2 2 32
Object Variable or With Block Variable not set - Microsoft Access vba 3 34
Help with DoEvents 8 28
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…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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.

803 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