On Deactivate (1 Viewer)

whwmsj

New member
Local time
Today, 19:24
Joined
Jun 10, 2019
Messages
4
Newbie with basic experience here, go easy on me please... ;)

I have a main form with a macro button that calls a second form which has a button that calls a third form. Each form overlaps the previous form.

I'd like to "gray out" each form on deactivate, but want it to remain visible and in the stack of forms. In other words, visually, the form on top with the focus appears to have the focus and all other do not. Once the current form is closed, I'd like the immediate form below it in the stack to change back from being grayed out to normal and have the focus.

Any and all help is greatly appreciated.

Bill.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:24
Joined
Oct 29, 2018
Messages
21,358
Hi Bill. Welcome to the forum. I am thinking maybe you can use a global array to store the names of the forms as you open them in order. This will help tell you which form to activate as each form is closed and its name is removed from the list.
 

whwmsj

New member
Local time
Today, 19:24
Joined
Jun 10, 2019
Messages
4
Hi Bill. Welcome to the forum. I am thinking maybe you can use a global array to store the names of the forms as you open them in order. This will help tell you which form to activate as each form is closed and its name is removed from the list.


Thank you for the welcome and response. Is there an "easier" way? Such as in the form's property sheet in Deactivate, simple code like Docmd… change background to Red? again, newbie here with minimal VBA experience.

Thanks,
Bill.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 23:24
Joined
Sep 12, 2006
Messages
15,614
do you not get a different appearance when you select a form at the moment?
 

missinglinq

AWF VIP
Local time
Today, 19:24
Joined
Jun 20, 2003
Messages
6,423
...Is there an "easier" way? Such as in the form's property sheet in Deactivate, simple code like Docmd… change background to Red...]

Sure...on each appropriate Form simple use:

Code:
[B]Private Sub Form_Activate()
 Me.Detail.BackColor = vbBlue
End Sub

Private Sub Form_Deactivate()
  Me.Detail.BackColor = vbRed
End Sub[/B]
substituting your own preferred colors.

Linq ;0)>
 

whwmsj

New member
Local time
Today, 19:24
Joined
Jun 10, 2019
Messages
4
Sure...on each appropriate Form simple use:

Code:
[B]Private Sub Form_Activate()
 Me.Detail.BackColor = vbBlue
End Sub

Private Sub Form_Deactivate()
  Me.Detail.BackColor = vbRed
End Sub[/B]
substituting your own preferred colors.

Linq ;0)>


Exactly what I was looking for. Thank you kindly!
 

missinglinq

AWF VIP
Local time
Today, 19:24
Joined
Jun 20, 2003
Messages
6,423
Glad we could help!

Good luck with your project!

Welcome to Access World!

Linq ;0)>
 

Users who are viewing this thread

Top Bottom