Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 707
  • Last Modified:

show / hide bitmap on a Continuous Form

Have a continuous form, given a field condition I want a bitmap to either show or hide.
The following works on a single form but not when I change to continuous:

   Private Sub Form_Current()
     If [IsEmail] = -1 Then [EmailLogo].Visible = True Else [EmailLogo].Visible = False
   End Sub
How do I make this work on a continuous form?
Thank you,
Shawn
0
ShawnGray
Asked:
ShawnGray
  • 7
  • 4
  • 3
  • +1
1 Solution
 
RgGray3Commented:
Conditional formatting is the way to change individual record formatting on continious forms
OK...   images do not have conditinal formatting

You can fake it....

Create a Solid background text field with it's backcolor = your forms backcolor...

Place it OVER the graphic you want to show and hide

Make it's visible property opposite of what you want the graphic to be....


 If [IsEmail] = 0 Then [BogusControl].Visible = True Else [BogusControl].Visible = False

But let's take an extra second

There is no reason to make an if out of it

BogusControl.Visible = Not IsEmail

Will do the trick.....    if IsEmail = true the Bogus control will have visibility set to false hence since the Graphic is hidden by the Bogus control.... it will be hidden no longer....

(I get like that at the end of the day)

Rich

0
 
ShawnGrayAuthor Commented:
Interesting idea but it looks like I have the same problem as before.
If I change to a single form it works.  Continuous forms do not.  
Each record gets its rule from the 1st record.
If the 2nd record is different, and I click the 2nd record, all records toggle to its rule.

0
 
Rey Obrero (Capricorn1)Commented:
can you attach your db? might find something that will work
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
ShawnGrayAuthor Commented:
Sure.  This is a sample to give you an idea.
Thank you.
sample.mdb
0
 
Jeffrey CoachmanCommented:
ShawnGray,

Images are cool and slick, but I would just do something like this and be done with it

my 2c

JeffCoachman
sample.mdb
0
 
ShawnGrayAuthor Commented:
I thought of that but in my real world database I don't have much room to work with.
The picture would be perfect.
0
 
Jeffrey CoachmanCommented:
<I don't have much room to work with>
...Then just make the texbox the same size as the email image and adjust the font size to fit.
0
 
ShawnGrayAuthor Commented:
If that solution is what I wanted, I wouldn't need to post the question.
I'm trying to solve for an image.  
0
 
Jeffrey CoachmanCommented:
ShawnGray,

Well,  then with the code you are using and the form being continuous,

The answer is "It cannot be done".

The image is a control.
If that control is not "Bound" to a control source, it will be the same for all records.
Remember the form is a mask, put on top of the data.

You look "through" the form at your data.
The image is part of the Form, not the data.

So, if you can find a way to "bind" the image to the checkbox, you could probably get it to do what you want.

JeffCoachman

JeffCoachman
0
 
Jeffrey CoachmanCommented:
ShawnGray,

For an example, see this link, and the attached sample:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_23453586.html

JeffCoachman

0
 
ShawnGrayAuthor Commented:
Understood.  Thank you for the help.
0
 
RgGray3Commented:
Sorry I have been out of the loop all day...  and you have a working solution...  Jeff is good that way...

But review my orig advice....

Using conditional formatting is not writing code during the format of the field...
Using conditional formatting from the format menu when the control is selected...

Give it a try is is an easy fix
0
 
ShawnGrayAuthor Commented:
RgGray3,
I don't see how this could work.  If I add a bogus control and write and event that toggles it on and off, its no different than attempting to toggle an image.  (see attached).

If I use a BogusControl infront of the image and use conditional formatting, I can hide it, but I can't let the image show through because "transparent" isn't allowed in these conditions.

I appreciate the creativity.  Am I missing something?
sample.mdb
0
 
RgGray3Commented:
Sorry...

When I reviewed my app that I did the same thing....  I too bound the graphic to a table containing my graphics....

I used my suggested trick for highlighting a control but not combined with graphics.

Thats what I get when I try to answer questions while eating a quick lunch



0
 
ShawnGrayAuthor Commented:
LOL.  Thanks again.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 7
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now