473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Display or not picture in report

1
Hello ,
I try to setup a code in which I want to test on the condition to display or not display a picture in a report.
First a question :
- do I have to open the report before or after the condition tests ?

The pictures - !YouaredoingGreat are predefined pictures in my report with the property 'visible' off

My code :

Expand|Select|Wrap|Line Numbers
  1. Dim weekrapport2 As Report
  2.     Set weekrapport2 = Report_WEEKRAPPORT
  3.  
  4. With weekrapport2
  5.  
  6. If weektotaalgained > 69 And weektotaalgained < 80 Then
  7. !YouaredoingGreat.Visible = False
  8. !YouaredoingGood.Visible = True
  9. !YouaredoingGood2.Visible = True
  10. !YouaredoingAverage.Visible = False
  11. !YouaredoingBellowAverage.Visible = False
  12. DoCmd.OpenReport stDocName, acViewPreview
  13. End If
  14.  
The result of this :
no error message, condition is fulfilled, picture is not visible ! Why ????

Thanks
Oct 20 '15 #1
1 806
jforbes
1,107 Expert 1GB
You'll want to move the code to set the images visible or not into the Report. Probably in the GroupHeader_Format or Detail_Format.

Here is an example of using an Image in a Footer. Hopefully it helps:
Expand|Select|Wrap|Line Numbers
  1. Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
  2.     Dim sSigFile As String
  3.     sSigFile = Nz(Me!SignatureFile, "")
  4.  
  5.     Me.imgSig.Visible = False
  6.     If Me!UseSignatureImage <> 0 Then
  7.         If Len(sSigFile) > 0 Then
  8.             sSigFile = gResourceDirectory & "\Signatures\" & sSigFile
  9.             If fileExists(sSigFile) Then
  10.                 Me.imgSig.Visible = True
  11.                 Me.imgSig.Picture = sSigFile
  12.             Else
  13.                 Call msgBoxError("Could not find the Signature file at: " & sSigFile)
  14.             End If
  15.         End If
  16.     End If
  17. End Sub
Oct 20 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Michael | last post by:
Hello, Is there a way to display Crystal Report file without depending on the Win form with CrystalReportViewer control in it, such as evoke the Crystal Report engine directly or something like...
0
by: Robert | last post by:
I find that most of the time my Access reports are displayed in print preview mode rather than printed on the printer. Converting these reports to a form with a continuous view is difficult...
1
by: Regnab | last post by:
Ive got a form on which I would like to display a report (sub-report). I tried to do this through subform/subreport, but it only allows a subform. Is it possible to display the report? Cheers ...
3
by: Mustufa Baig | last post by:
I would to be able to display crystal report via ASP.NET by using CrystalViewer Web Component and by exporting as well. Thanks.
8
by: rzaleski | last post by:
I am trying to display a Crystal Report in an application I developed. I used the following tools: Microsoft Visual Studio.NET 2005 Standard Crystal Reports 10 Professional I am using the...
1
by: software student | last post by:
i need to select a picture from sql server, picture is stored as path and have to display it in the picture box. now i dont understand how to covert it to picture box type
46
by: OldBirdman | last post by:
What a mess this question is. I have spent 2 weeks trying to make it concise and clear, and I can't. I do not have the vocabulary for the question. I cannot even TITLE it correctly. Here is my...
0
Sl1ver
by: Sl1ver | last post by:
Hi there in my settings section i created a place for company details, Uploading a picture means it will load a picture and save the string of where it can be found to the db(access). Now on my...
3
by: kivaniya | last post by:
want to display a table with Name, Age and picture from images folder - need code to insert image - field called Picture in MYSQL Database <?php $con = mysql_connect("localhost","db","pass");...
15
by: smills | last post by:
Access 2010 I have a Report Footer that sums fields displayed in the Detail section. In Report View, the detail items display correctly but the sums in the Report Footer shows 0 unless I click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.