UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Continuous Forms Show Different Image For Each Row, Access 2016    
 
   
Sweetu
post May 25 2019, 04:22 PM
Post#1



Posts: 109
Joined: 20-September 16



Hi Dears,

How can we show the different image for each row on continuous forms,on which event we should put the code , I tried to add the below code on continuous Form but all the images showing up .

Now when I focus on Sign textbox where the value is Info all the Form Images will be shown as info ,if I focus on 2nd row where sign textbox value warning than all the form images will show the warning image ,

Couldn't figure out , please hep

CODE
Private Sub Form_Current()

If Me.Sign.Value = "Info" Then
    Me.ImgInfo.visible = True
    Me.ImgWarning.visible = False
    Me.ImgCritical.visible = False

Else
    If Me.Sign.Value = "Warning" Then
        Me.ImgWarning.visible = True
        Me.ImgInfo.visible = False
        Me.ImgCritical.visible = False

    Else
        If Me.Sign.Value = "Critical" Then
            Me.ImgCritical.visible = True
            Me.ImgInfo.visible = False
            Me.ImgWarning.visible = False
End If
    End If
        End If
End Sub
Go to the top of the page
 
Doug Steele
post May 25 2019, 04:45 PM
Post#2


UtterAccess VIP
Posts: 22,165
Joined: 8-January 07
From: St. Catharines, ON (Canada)


Sorry, but that's how Access forms are implemented. If you programmatically change one row, it'll affect all rows.

I don't typically work with images in Access, but I believe that if you can have the query return the appropriate image path as part of the recordset, you could bind the image control to that and have it work.

--------------------
Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page
 
Sweetu
post May 25 2019, 05:02 PM
Post#3



Posts: 109
Joined: 20-September 16



@ Doug Steele ,
any other approach if yu can suggest please?
so dear we can't also use separated command button in continuous Form for each records ?
This post has been edited by Sweetu: May 25 2019, 05:11 PM
Go to the top of the page
 
Doug Steele
post May 25 2019, 06:45 PM
Post#4


UtterAccess VIP
Posts: 22,165
Joined: 8-January 07
From: St. Catharines, ON (Canada)


Did my suggestion not work, or did you just not try it?

What do you want the command buttons to do? You can determine which row is the active one when the command button is pressed, so you can take different actions depending on which button was pressed, but if you're looking to put different captions on the command buttons, I'm afraid you can't.

--------------------
Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page
 
Sweetu
post May 26 2019, 04:09 AM
Post#5



Posts: 109
Joined: 20-September 16



@ Doug Steele ,
thanks for your reply,
QUOTE
Did my suggestion not work, or did you just not try it?

I tried your solution ,created another table & make query for same fields now the images are appearing correctly on continuous Form,

QUOTE
What do you want the command buttons to do? You can determine which row is the active one when the command button is pressed, so you can take different actions depending on which button was pressed, but if you're looking to put different captions on the command buttons, I'm afraid you can't.


on click button I want to update the checkbox on Form , but now it seems not possible because the query isn't update-able ,

Should I've to create another query which run when the command button clicked ? and how to determine active row ? which event( on activate ) ?
Go to the top of the page
 
gemmathehusky
post May 26 2019, 06:55 AM
Post#6


UtterAccess VIP
Posts: 4,693
Joined: 5-June 07
From: UK


If you can get the text values into your query as "info", "warning", "critical", then you can add conditional formatting to change their bg colours. That should work well.

It's hard to be absolute about anything, as MS keep adding functionality - but the problem with a continuous from is that you only design one row, and all the visible rows are clones of that row, except where the bound data differs. (if that makes sense)



--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
Doug Steele
post May 26 2019, 07:10 AM
Post#7


UtterAccess VIP
Posts: 22,165
Joined: 8-January 07
From: St. Catharines, ON (Canada)


What's the SQL of the query that's not updatable?

For that matter, can you explain in words what you're trying to accomplish? It's kinda hard to offer suggestions when we don't know what's supposed to be done! smile.gif

--------------------
Doug Steele, Microsoft Access MVP (2000-2018)
Personal webpage
Microsoft profile
Co-author: Access Solutions: Tips, Tricks, and Secrets from Microsoft Access MVPs, published by Wiley
Co-author: Effective SQL: 61 Specific Ways to Write Better SQL, published by Addison-Wesley Professional
Technical Editor: Access 2010 Bible, Access 2013 Bible, Access 2016 Bible, all published by Wiley
Technical Editor: SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition, published by Addison-Wesley Professional
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th June 2019 - 10:53 PM