Solved ACCDE hide Ribbon stopped working (1 Viewer)

DLTaylor

New member
Local time
Today, 23:28
Joined
Jul 11, 2019
Messages
9
Hi,

I look after a small MS ACCESS DB - we use office 365 and have latest updates on.

The DB loads with a Display Form: "frmLoginDialog" - this lets a user select their NAME and IMPORTANTLY - runs VBA command

Private Sub Form_Load()
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End Sub

...to HIDE The ribbon across the top.

When the DB is in ACCDB the command runs as expected - THEN when is Save As ACCDE the database seems to ignore it and now shows the RIBBON.

In the 10 or so times i have done this in the past its worked perfectly - for some reason its stopped working .. please can you help? - I’m puzzled and not experienced enough to come up with a 'workaround'

Thanks
 

arnelgp

error reading drive A:
Local time
Tomorrow, 06:28
Joined
May 7, 2009
Messages
9,286
you may use other method like this:
Code:
If CommandBars("Ribbon").Height > 100 Then
     CommandBars.ExecuteMso "MinimizeRibbon"
End If
 

zeroaccess

Active member
Local time
Today, 17:28
Joined
Jan 30, 2020
Messages
586
Mine still works - was there an upgrade recently to 365 and/or 64-bit? Is there any other startup code that now fails that is interfering with it? Here is a copy and paste of mine in 64-bit Access version 1908:

NGINX:
Private Sub Form_Load()
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.ApplyFilter , "[LAN ID]='" & fOSUserName & "'"
End Sub
 

strive4peace

AWF VIP
Local time
Today, 17:28
Joined
Apr 3, 2020
Messages
482
hi DL

before you save as ACCDE, Compile and Save the code

~~~~~~~~~ Compile ~~~~~~~~~

Whenever you change code, references, or switch versions or operating environment, or modify objects with code behind them, you should always compile and save before executing any code.

from the menu in a VBE (module) window: Debug, Compile [the name of your project]
(Alt-F11 to switch to the code window)

Fix any errors on the highlighted lines.
Add needed references, remove unnecessary references, resolve missing references
(from the menu: Tools, References...)

keep compiling until nothing happens (this is good!) -- then Save

also be sure, before compiling, to use Option Explicit at the very TOP of each module so variables that are not declared or are misspelled will be picked up by the compiler as well as many other errors than can be fixed before running.
 

DLTaylor

New member
Local time
Today, 23:28
Joined
Jul 11, 2019
Messages
9
Hi All,
Thanks all the help :)

I dont think its a bug from a windows upgrade -(remember the: Access error: "Query is corrupt" - in December update - yikes!)

.. its something in my code. Im working through DB changes to spot when it happens.

The compile code doesn't pick up on any errors - i did hope it would be this ;-)

Will post back once understood and share with you

Thanks
Dan
 

strive4peace

AWF VIP
Local time
Today, 17:28
Joined
Apr 3, 2020
Messages
482
Dan, great that the compiler didn't have an errors! Save the compiled code before running, or making the ACCDE
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:28
Joined
Feb 19, 2013
Messages
12,092
perhaps too basic - but I presume the accde is in a trusted location - code will not run unless it is or you have clicked the enable button
 

arnelgp

error reading drive A:
Local time
Tomorrow, 06:28
Joined
May 7, 2009
Messages
9,286
the only message you get on running an .ACCDE file (not in Trusted Location) is a MessageBox, either you answer Open (all codes will execute) and Cancel.
 

DLTaylor

New member
Local time
Today, 23:28
Joined
Jul 11, 2019
Messages
9
ok so - problem solved! whoop
I recompiled the code in source ACCDB file - didn't get any errors - but this time SAVED after the compile. (I'm sure its the SAVE that did the trick)
When i saved AS ACCDE the DB worked as expected! :)

Strive4Peace shoud get the credit as haddnt thought of doing the above SAVE action! (y)
 

strive4peace

AWF VIP
Local time
Today, 17:28
Joined
Apr 3, 2020
Messages
482
you're welcome, Dan ~ happy to help

there is a way to mark this as Solved, but I've not asked a question so I don't know how!
 

Megaduck

New member
Local time
Today, 18:28
Joined
Apr 24, 2020
Messages
24
I'm having this problem currently. Everything works fine, then it starts acting up when in ACCDE. It will actually work a few times, then it converts to showing ribbons (showing home and file) and no options. I used USysRibbons at one point to do this but I didn't like the ribbon showing at all. I've removed the USysRibbons table and reverted the options back to default. But for some reason the DoCmd.ShowToolbar "Ribbon", acToolbarNo code stops working and goes back to fresh ribbon despite no code in the DB to do that. I've compiled and saved before saving as ACCDE. No errors. I'm at a loss for how to fix this problem. Any ideas?
 

Megaduck

New member
Local time
Today, 18:28
Joined
Apr 24, 2020
Messages
24
I went into the registry and deleted everything related to Access and it works again.... why does it keep bringing into Access old settings though?
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:28
Joined
Sep 21, 2011
Messages
5,708
you're welcome, Dan ~ happy to help

there is a way to mark this as Solved, but I've not asked a question so I don't know how!
Top right of the thread that anyone (o/p) has posted.?

1588515843823.png
 
Last edited:

strive4peace

AWF VIP
Local time
Today, 17:28
Joined
Apr 3, 2020
Messages
482
I went into the registry and deleted everything related to Access and it works again.... why does it keep bringing into Access old settings though?
Glad you figured it out! As for why ... I'm assuming that each time it updates, default settings are applied -- not convenient, but at least you know how to fix it!
 

isladogs

CID Moderator
Staff member
Local time
Today, 23:28
Joined
Jan 14, 2017
Messages
13,151
Glad you figured it out! As for why ... I'm assuming that each time it updates, default settings are applied -- not convenient, but at least you know how to fix it!
It shouldn't do so, not even after an update
 

strive4peace

AWF VIP
Local time
Today, 17:28
Joined
Apr 3, 2020
Messages
482
I agree, Colin -- and another inconvenience is that you might have to reinstall add-ins ... so I'm dragging my feet on updating!
 

isladogs

CID Moderator
Staff member
Local time
Today, 23:28
Joined
Jan 14, 2017
Messages
13,151
Confused. I thought I said the opposite to your post :unsure:
 

zeroaccess

Active member
Local time
Today, 17:28
Joined
Jan 30, 2020
Messages
586
I'm having this problem currently. Everything works fine, then it starts acting up when in ACCDE. It will actually work a few times, then it converts to showing ribbons (showing home and file) and no options. I used USysRibbons at one point to do this but I didn't like the ribbon showing at all. I've removed the USysRibbons table and reverted the options back to default. But for some reason the DoCmd.ShowToolbar "Ribbon", acToolbarNo code stops working and goes back to fresh ribbon despite no code in the DB to do that. I've compiled and saved before saving as ACCDE. No errors. I'm at a loss for how to fix this problem. Any ideas?
Try a full decompile and recompile: https://www.access-programmers.co.u...n-total-number-of-objects.310767/post-1684991

Access updates have no bearing on your VBA code except in circumstances of changing bit depth.

Otherwise, there may be other code interfering with DoCmd.ShowToolbar "Ribbon", acToolbarNo at startup.
 

Micron

AWF VIP
Local time
Today, 18:28
Joined
Oct 20, 2018
Messages
2,706
Access updates have no bearing on your VBA code except in circumstances of changing bit depth.
That is incorrect. Access upgrades break code for at least two reasons that we have seen here:
- deprecated features/controls such as old calendar control
- sloppy code that worked before but doesn't after an upgrade. Once the code was fixed, the issue went away. Older version seemed less picky about some syntaxes.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom