iif statement.

pekajo

Registered User.
Local time
Today, 15:56
Joined
Jul 25, 2011
Messages
135
Hi,
I am trying to print business cards but need to 'switch' off the logo (image) depending on the field [Surname]. (Please see attached jpg)

My iif statement is as follows which I have placed in the image Control Source.

iif([Surname] = "a",[Image42].visible = False)

However it does not work.
Any ideas
Peter
 

Attachments

  • cards.jpg
    cards.jpg
    32.7 KB · Views: 94
Hi. The IIf() function returns a value. You can’t use it to return a code statement.
 
add code to the Report's Detail section: Format event:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.[Image42].Visible = (Me.[SurName] <> "a")
End Sub
 
Hi,

Thanks for the reply. Entered as suggested. And got the attached error. I tried changing the image and is now image49

Me.[Image49].Visible = (Me.[Surname] <> "a")

Is it something I have typed?

Peter
 

Attachments

  • error.jpg
    error.jpg
    11.4 KB · Views: 84
check the Textbox name and image name if correct, then rectify.
 
Hi,
Double checked so thought I would go the whole hog and add Reports!Reportname!image....
worked like a charm.

Thanks for you help.
Peter
 
Hi,
Double checked so thought I would go the whole hog and add Reports!Reportname!image....
worked like a charm.

Thanks for you help.
Peter

Hi Peter. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom