How can I make the rest of the Form look dim when I have something selected? (1 Viewer)

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
I have a couple of List Boxes that work together to allow the user to make multiple selections for the Applicable Fleet. During the non-editing phase, the left List Box is hidden. When I click the Edit Icon, the Event fires and makes it visible. At this stage, I would like the rest of the Form to go ever so slightly tinted so that the user's focus is maintained on the bit that they should be editing.

Is there any way to do this without having a really big rectangle across the Form which is translucent which triggers and visible/invisible based on whether I am editing?
 

isladogs

MVP / VIP
Local time
Today, 23:04
Joined
Jan 14, 2017
Messages
18,186
See my attention seeking database. It’s in the sample databases area and includes a background dimmer as well as other ways of getting users’ attention


Sent from my iPhone using Tapatalk
 

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
Some pictures attached to aid the explanation.

When I click the Edit Icon, I will want the Form to end up looking like the image in "Desired Look Of Editing Phase.jpg" and then when I click on the Tick Icon, for it to go back to the "Back To Non-Editing Phase.jpg".

What options are there for me to achieve something like this? I am open to ideas.
 

Attachments

  • Desired Look Of Editing Phase.jpg
    Desired Look Of Editing Phase.jpg
    37.4 KB · Views: 70
  • Editing Phase.jpg
    Editing Phase.jpg
    33.2 KB · Views: 62
  • Back To Non-Editing Phase.jpg
    Back To Non-Editing Phase.jpg
    32.1 KB · Views: 64
  • Non-Editing Phase.jpg
    Non-Editing Phase.jpg
    32.1 KB · Views: 62

isladogs

MVP / VIP
Local time
Today, 23:04
Joined
Jan 14, 2017
Messages
18,186
That’s not possible with my previous suggestion. What you can do is disable all the other controls ( the tag property is good for this) and change the background colour. Then reverse the effect when done


Sent from my iPhone using Tapatalk
 

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
Cool I have downloaded the AttentionSeek database and it looks as though it is going to be a really useful resource.

When using your dimming code to fire when something is clicked, I am running into an issue when I try getting it to open a Form.

Any idea what might be causing this issue and how to resolve it?

Code:
Private Sub EditIconFleet_Click()

'dim background
    Form_frmDimmer.DoDim Me
    
On Error GoTo Err_DatabaseConfiguration_Click

    Dim stDocName As String

    stDocName = "frmMessageForm"
    DoCmd.OpenForm stDocName, acNormal

Exit_DatabaseConfiguration_Click:
    Exit Sub

Err_DatabaseConfiguration_Click:
    MsgBox Err.Description
    Resume Exit_DatabaseConfiguration_Click
    
'restore background
    Form_frmDimmer.UnDim

End Sub
 

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
Edit: Oops I noticed that I hadn't deleted the On Load and Data aspects of the Form that I was trying to load and play around with. Classic case of how copying and pasting from 1 database to another is a bad thing to do unless you ensure you copy across the relevant modules / code / set up etc.
 

isladogs

MVP / VIP
Local time
Today, 23:04
Joined
Jan 14, 2017
Messages
18,186
Excellent. Glad you liked the dimmer effect. However as I said earlier it dims all except the active form. It can’t dim part of a form as you wanted in your screenshots. My second reply indicated how to do that


Sent from my iPhone using Tapatalk
 
Last edited:

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
I am having a play around by moving the items that were inside of the subform for the multi select list and making them into their own form so that it will give the effect I was looking for. Now I am currently struggling on how to make Access perform the update once I have updated the data in the Multi Select Form. I can get the Update phase to work, the issue is that when it requeries it takes me back to the first record in the main Form.
 

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
And update to the above - the code I am using is:

Code:
Private Sub FinishIconFleet_Click()

On Error GoTo Err_FinishIconFleet_Click

DoCmd.Close
Form_frmDimmer.UnDim
Forms![FrmOverview].Form.Requery
    
Exit_FinishIconFleet_Click:
    Exit Sub

Err_FinishIconFleet_Click:
    MsgBox Err.Description
    Resume Exit_FinishIconFleet_Click

End Sub

And I have identified that it is the below that is causing it to jump back to the first record in the Form. Is there any way for it to requery and then take me back to the record that I was just on?

Code:
Forms![FrmOverview].Form.Requery
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:04
Joined
May 7, 2009
Messages
19,169
to op, you first save the PK to variable, requery and go back to it:
Code:
Private Sub FinishIconFleet_Click()
[COLOR="Blue"]Dim lngID As Long[/COLOR]
On Error GoTo Err_FinishIconFleet_Click

DoCmd.Close
Form_frmDimmer.UnDim
[COLOR="blue"]lngID =Forms![FrmOverview]!ID[/COLOR]
Forms![FrmOverview].Form.Requery
[COLOR="blue"]Forms![FrmOverview].Form.Recordset.FindFirst "ID=" &  lngID[/COLOR]
Exit_FinishIconFleet_Click:
    Exit Sub

Err_FinishIconFleet_Click:
    MsgBox Err.Description
    Resume Exit_FinishIconFleet_Click

End Sub
 

isladogs

MVP / VIP
Local time
Today, 23:04
Joined
Jan 14, 2017
Messages
18,186
I am having a play around by moving the items that were inside of the subform for the multi select list and making them into their own form so that it will give the effect I was looking for.

Did you try the other approach I also suggested earlier?
 

Cark

Registered User.
Local time
Today, 16:04
Joined
Dec 13, 2016
Messages
153
I tried it and ended up finding that moving them to their own forms made things look good enough for what I wanted the user to see, whilst being a bit more intuitive for me to edit. This decision doesn't seem to have bitten me yet, but I appreciate the suggestion. Seems as though there are many ways to achieve the same kind of result, but obviously each method has its own subtleties.
 

Users who are viewing this thread

Top Bottom