Visible Form not coming up as "Visible" when checked (1 Viewer)

evictme

Registered User.
Local time
Today, 12:28
Joined
May 18, 2011
Messages
168
Hello All,

I have a few forms that are opened as achidden when the database opens and I have a few buttons that will change their property to visible and display the form as necessary.

However, I also have accesswindowhidden vba coding and I am looking to keep the visible forms visible while hiding the accesswindow.

I have procedures all over the place but essentially they check if the form is visible and then just open it or make it visible again:

Please use Code Tags

Code:
If [Forms]![Clients].visible = true then
DoCmd.OpenForm "Clients", acNormal, , , , acWindowNormal
[Forms]![Clients].Visible = True
End If
But it does not fire. I did a MSgBOX Forms!Clients.visible and it shows as False despite it being open and visible.
I also tried creating a textbox that will display the visibility of the form and linked that to the procedure event mentioned above but the forms show as not visible, again, despite being open and visible.

What am I missing? What can I check? Am I missing a property here?


This is what I have to open the form:
Code:
Clients_OnClick

Set rs = CurrentDb.OpenRecordset("SELECT * FROM ButtonClicks")

rs.AddNew

rs![ButtonClick] = Clients.Caption
rs![ClickTime] = Time()
rs![ClickDate] = Date
rs![User] = CurrentUser()

rs.Update
rs.Close

Set rs = Nothing

DoCmd.RunMacro "mcrHide"


If CurrentProject.AllForms("Mission Control").IsLoaded = True Then
DoCmd.OpenForm "Mission Control", acNormal
End If

If [Forms]![Employees].Visible = True Then
DoCmd.OpenForm "Employees", acNormal, , , , acWindowNormal
End If

If [Forms]![NewEmployeeForm].Visible = True Then
DoCmd.OpenForm "NewEmployeeForm", acNormal, , , , acWindowNormal
End If

If [Forms]![EAA - Database].Visible = True Then
DoCmd.OpenForm "EAA - Database", acNormal, , , , acWindowNormal
End If
[code]

[B][Forms]![Clients].Visible = True
[Forms]![Clients].SetFocus[/B]

End Sub


Any help would be greatly appreciated...been at this for a while and just found out that the reason its not firing is because it is not registering as visible.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:28
Joined
Oct 29, 2018
Messages
21,473
Hi. I read your post, but I'm a little bit lost. For example, in one of the sections, you check if a form is already open and then proceed to open it if it is.

Similarly, in the other sections, you check if a form is visible and then make it visible if it is visible.

Are you able to post a demo db to show what's really happening? Just curious...
 

isladogs

MVP / VIP
Local time
Today, 18:28
Joined
Jan 14, 2017
Messages
18,219
Try looking at my example app Control the Application Interface which should provide any code you nay need for this purpose.

EDIT
I also found your code confusing. The first snippet sets a form visible if it is already visible...!
The main section of code is equally unclear...
 

evictme

Registered User.
Local time
Today, 12:28
Joined
May 18, 2011
Messages
168
Sorry about the code tags.

Yes, What I have found in my experience with minimizing or hiding the Access Window is that reloading/reopening the form has allowed for it to pop-up while keeping the access window hidden.

I am trying to minimize as much contact with the access window as possible for the users.

So, When trying to get at a set of procedures that would help with this I saw that checking if the form is loaded and then reopening it would solve the problem.

However, since I have recently transitioned these forms to open as hidden when opening the database I want to update the procedures to check if the forms is visible.

What is happening is that the forms are not being registered as visible despite being open and visible. This makes me wonder if there is something I am missing.

The coding above in the OnCLick event after the Macro is to "refresh" (so to speak) the forms while opening the form I want and minimizing the access window.

Before, each form was actually opened by similar OnClick events on other buttons and checking if a form was loaded then re-opening it after the hideaccesswindow macro would successfully provide the experience (illusion/appearance) of the forms not going anywhere while getting rid of the access window.

Now, the visibility of the form does not register with access...it does not see it as "Visible"
 

evictme

Registered User.
Local time
Today, 12:28
Joined
May 18, 2011
Messages
168
The Forms are Pop-Up, I want the users to be able to move the form to any position on the screen they want...hence the need for minimizing the access window at all times.
 

isladogs

MVP / VIP
Local time
Today, 18:28
Joined
Jan 14, 2017
Messages
18,219
Have you looked at my example app yet? It allows you to do exactly that, even with borderless forms!
 

Users who are viewing this thread

Top Bottom