Answered by:
MS Access Form Sidebar Menu Animation

Question
-
I've been trying to create sort of a sidebar menu that would pop in when you click on a button for quite a bit now and for some reason, I am unable to do it. When I save the code and open the form to test, the "side menu" (which is another form") can be seen instead of being out of the are that you can see. The code I am using is as follows.
Option Compare Database Private Sub Command0_Click() Dim x As Integer x = 0 Do DoEvents TestForm2.Left = TestForm2.Left - 100 timeout (0.0075) x = x + 1 Loop Until x = 50 End Sub Private Sub Form_Load() Me.ScrollBars = 0 TestForm2.Left = Me.Width + 1000 End Sub Sub timeout(duration_ms As Double) Start_Time = Timer Do DoEvents Loop Until (Timer - Start_Time) >= duration_ms End Sub
- Edited by MarkCallaway Wednesday, December 20, 2017 11:37 AM
Monday, December 18, 2017 6:29 PM
Answers
-
Hi Mark,
Thanks. If the main issue is the side menu/form is visible right away when you initially open the form and you don't want it to be, how about simply setting its Visible property to No and set it to Yes when the user click on the Menu button?
Just a thought...
- Marked as answer by MarkCallaway Wednesday, December 20, 2017 11:38 AM
Monday, December 18, 2017 7:08 PM
All replies
-
Hi,
Not sure I understand your question. Have you tried using either the Move or MoveSize method?
Can you post some screenshots to illustrate the problem? Thanks.
Monday, December 18, 2017 6:41 PM -
Hi,
Not sure I understand your question. Have you tried using either the Move or MoveSize method?
Can you post some screenshots to illustrate the problem? Thanks.
Hi!
Thank you for your reply. I am actually trying to achieve a sidebar menu effect like the one seen here: imgur. com/a/sJeZ9
Here's an illustration of my issue. youtube. com/watch?v=e4cd0nX8Xqw
I am not allowed to post screenshots, so I had to put a space in the domain.Monday, December 18, 2017 6:52 PM -
Hi Mark,
Thanks. If the main issue is the side menu/form is visible right away when you initially open the form and you don't want it to be, how about simply setting its Visible property to No and set it to Yes when the user click on the Menu button?
Just a thought...
- Marked as answer by MarkCallaway Wednesday, December 20, 2017 11:38 AM
Monday, December 18, 2017 7:08 PM -
Hi Mark,
Thanks. If the main issue is the side menu/form is visible right away when you initially open the form and you don't want it to be, how about simply setting its Visible property to No and set it to Yes when the user click on the Menu button?
Just a thought...
Monday, December 18, 2017 7:37 PM -
Yes. Could you set the subform Visible=No? Will that work for you?Monday, December 18, 2017 7:41 PM
-
Yes. Could you set the subform Visible=No? Will that work for you?
That worked perfectly until I added the same sort of "animation" to the button (I tried to add the move animation to the button so that it moves along the menu). youtu. be/K367QDQs-lQMonday, December 18, 2017 10:54 PM -
Hi,
Glad to hear we got the first problem fixed. So, the original problem of the menu subform showing up right away is now gone, correct? I watched the video but I am not sure I understand what is the new problem with the menu button. Are you saying it is supposed to stay to the left side of the menu subform? If so, then I am guessing it's just a matter of adjusting your math to make sure the position of the button is always to the left of the menu or the position of menu is always to the right of the button.
For example, if the menu subform is coming from the right side, then the Left value position of the button should be less than the Left value position of the menu subform plus its Width.
Hope it helps...
Tuesday, December 19, 2017 2:43 AM -
Hi,
Glad to hear we got the first problem fixed. So, the original problem of the menu subform showing up right away is now gone, correct? I watched the video but I am not sure I understand what is the new problem with the menu button. Are you saying it is supposed to stay to the left side of the menu subform? If so, then I am guessing it's just a matter of adjusting your math to make sure the position of the button is always to the left of the menu or the position of menu is always to the right of the button.
For example, if the menu subform is coming from the right side, then the Left value position of the button should be less than the Left value position of the menu subform plus its Width.
Hope it helps...
Hi!
Indeed. The button itself should be left to the side menu. Though, no matter what value I put in the "Left" value, the effect remains as in the video. What I was trying to achieve was the button to move along with the menu when you click on it.
The effect that I got is the menu playing out weird, but code-wise, I doubt it should be so.
Tuesday, December 19, 2017 8:19 AM -
Hi Mark,
Can you email me a copy of your file, so I can take a look? It should be just a matter of referring to each object rather than using a literal value. Thanks.
Tuesday, December 19, 2017 4:33 PM -
Hi MarkCalaway,
It seems your origianl issue has been resolved, if so, I would suggest you mark the helpful reply as asnwer to close current thread.
For this new issue, I would suggest you post a new thread, and share us a demo file which could reproudce your issue. Then, we could achieve your requirement based on your demo project.
Regards,
Tony
Help each other
Wednesday, December 20, 2017 9:28 AM