Solved

show / hide bitmap on a Continuous Form

Posted on 2008-06-24
15
661 Views
Last Modified: 2013-11-28
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
Comment
Question by:ShawnGray
  • 7
  • 4
  • 3
  • +1
15 Comments
 
LVL 11

Expert Comment

by:RgGray3
ID: 21860082
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
 

Author Comment

by:ShawnGray
ID: 21860312
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
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21860496
can you attach your db? might find something that will work
0
 

Author Comment

by:ShawnGray
ID: 21860602
Sure.  This is a sample to give you an idea.
Thank you.
sample.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21861455
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
 

Author Comment

by:ShawnGray
ID: 21861622
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21861943
<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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ShawnGray
ID: 21865463
If that solution is what I wanted, I wouldn't need to post the question.
I'm trying to solve for an image.  
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 21867382
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21867415
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
 

Author Comment

by:ShawnGray
ID: 21867422
Understood.  Thank you for the help.
0
 
LVL 11

Expert Comment

by:RgGray3
ID: 21869331
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
 

Author Comment

by:ShawnGray
ID: 21870419
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
 
LVL 11

Expert Comment

by:RgGray3
ID: 21871119
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
 

Author Comment

by:ShawnGray
ID: 21874607
LOL.  Thanks again.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

746 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

13 Experts available now in Live!

Get 1:1 Help Now