Can a form be "greyed out" or have a darker color layered over it? (1 Viewer)

Abes

New member
Local time
Today, 22:14
Joined
Jul 2, 2021
Messages
21
Good Day All - I have a form (lets call it mainform) covering most part of the screen, and in which I have a button which opens a popup form.
Is it possible to have mainform either grey out or have a layer of a darker color over the entire form, activated by the onclick event of the button which opens the popup, and then when the popup is closed the mainform is restored to its previous state?

Reason for this is that the mainform (being full of controls) distracts the user when the popup opens and gives the whole screen a bit of an untidy appearance.

Thanks
 

Ranman256

Well-known member
Local time
Today, 16:14
Joined
Apr 9, 2015
Messages
4,339
Code:
public const kGRAY = 15132391

sub btnOpenFrm_click()
me.detail.backcolor = kGRAY
docmd.openform "fPopup"
end sub

in the popup form, the UNLOAD event set the color back:
Code:
sub form_unload(cancel )
  forms!fMainForm.detail.backcolor = vbWhite
end sub
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 16:14
Joined
Apr 27, 2015
Messages
6,286
In addition to RanMan's solution, you may be interested is this thread by one of our members, IslaDogs. One of the features is a blurred-out background instead of a total opaque cover.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:14
Joined
May 7, 2009
Messages
19,169
sample db is mine but the code for dimming is by Mr. Rob Cooper, The Access Team Blog.
i cannot claim for anything that i only frankenstined.
 

Attachments

  • TR2Materials.accdb
    5.4 MB · Views: 478

Users who are viewing this thread

Top Bottom