UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
6 Pages V  1 2 3 > »   (Go to first unread post)
   Reply to this topicStart new topic
> Side Menu Interface Revisioned, Office 2007    
 
   
jhcarrell
post Mar 19 2011, 12:00 PM
Post#1



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Many of you may be familiar with the SideMenu thread started by Rex.
After tinkering with it for a while I decided to dig into the code to see if there were any useful changes that could be made.
This post will be the first of an intended series; documenting my modifcation of the examples posted in the original thread.
If anyone has any questions, comments, or suggestions please feel free to reply to this thread.
-Enjoy-
J
====================
tblUsers.UserAccessLevel
- - - - - - - - - -
Oremoved the userAccessLevel value list lookup field in tblUsers.
In its place I created tblUserAccessLevel and added a foreign key field to tblUsers.
====================
frmSideMenuAdmin.MenuItemAccess [combo]
- - - - - - - - - -
I changed the Row Source Type from Value List to Table/Query and set the Row Source to tblUserAccessLevel. This will keep the control up-to-date in case of the addition/modification/removal of access levels.
====================
frmLogin
- - - - - - - - - -
Private Sub cboUserName_AfterUpdate()
I modified the “If Me.cboUserName.Column()” statement to reference column 3 (userAccessLevel) instead of column 1 (username) as this is a more logical and efficient approach to accomplish the purpose of this event (disable frmLogin.txtPassword for a selected userAccessLevel(s)).
- - - - - - - - - -
Private Sub cmdLogin_Click()
I modified the “If Me.cboUserName.Column()” statement to reference column 3 (userAccessLevel) instead of column 1 (username) as this is a more logical and efficient approach to accomplish the purpose of this event (load frmDesktop without userPassord for a selected userAccessLevel(s)).
====================
clsSideMenu
- - - - - - - - - -
Private Function getUserAccessLevel()
I disabled “DoCmd.Close acForm, “frmLogin”, asSavePrompt” in order to reference the current user from frmLogin.cboUserName after login has been completed. I will expound on this in subsequent posts.
====================
frmDesktop
- - - - - - - - - -
cmdMenuHide/cmdMenuShow
These icons where added to the header for the purpose of hiding and showing the side menu.
- - - - - - - - - -
cmdHome
This icon was added to the header for the purpose of a quick return to the default form. This will undergo further modification in subsequent posts.
- - - - - - - - - -
cmdWebMail
This icon was added to the header to serve as an example for navigating to a website by using a browser control.
- - - - - - - - - -
cmdCalendar
This icon was added to the header for the purpose of displaying the example calendar from in the workspace subform.
- - - - - - - - - -
cmdLogOut
This icon was added to the header for the purpose of closing frmDesktop and hidden frmLogin followed by opening dialog frmLogOut.
====================
frmLogOut
- - - - - - - - - -
This form was added as a dialog after closing frmDesktop. From it you may either quit access or log back in. This type of dialog is useful when different users may access the database on the same workstation without signing in and out of windows.
Attached File  SideMenuInterface_v01.zip ( 740.97K )Number of downloads: 1710
Go to the top of the page
 
jhcarrell
post Mar 20 2011, 11:42 AM
Post#2



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Next step: Parent Menu Item Access Management
rmSideMenuAdmin is the form used the manage which parent menu items are visible depending on a user's access level and the access level assigned to the menu item.
In Rex's version, he used:
CODE
Public Property Get GroupSource() As String
GroupSourceSQL = "SELECT * " & _
"FROM " & GroupTable & " " & _
"WHERE MenuItemAccess >= " & UserAccessLevel & " " & _
"AND Active = True " & _
"AND MenuItemParent = 0 " & _
"ORDER BY MenuItemOrder;"
End Property

... in the clsSideMenu module to determine which "Parent Menu Items" would be displayed in the side menu of frmDesktop. If you observe the "WHERE" statement, you can see that it is setup in a way that follows a simple hierarchy [>=]. (e.g. In my example there are currently four access levels: Administrator(1), PowerUser(2), User(3), and Guest(4). The current configuration allows Guests to see only items for the access level (as they are currently at the lowest level), Users can see all Parent Menu Items for Guests plus those having User as the minimum access level. This remains true for all levels as you step up the hiarchy (each higher level can see everything the lower levels could).)
One of my goals with this project is to develop a more flexible method for parent menu items. (e.g. Guest(4) can only see items for their specific access level, User(3) can see items for their access level but not for Guest(4), PowerUser(2) can see items for their access level as well as for User(3) but not Guest(4), and Administrator(1) can see all levels.)
This type of setup would require the ability to mix and match which access level can see each parent menu item.
My first inclination to accomplish this was to remove the ">" from the "WHERE" statement and to setup up a multi-value list box on frmSideMenuAdmin in place of MenuItemAccess combo. This was not successful in my tests, but I admittedly have limited experience with multi-value controls as I rarely have need to utilize them.
Anyone have any ideas or suggestions to accomplish this?
Go to the top of the page
 
jhcarrell
post Mar 20 2011, 05:27 PM
Post#3



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Note: I tried utilizing a multi-value field for tblSideMenuItem.MenuItemAccess and multi-value list box for frmSideMenuAdmin.MenuItemAccess, and removed the ">" from the WHERE statement of clsSideMenu>GroupSource().
quot;Error 3831: (The multiple value field 'MenuItemAccess' cannot be used in a WHERE or HAVING clause.) in procedure GroupSetup of clsSideMenu"
I'm not a fan of multi-value fields and suspect I need to be going about this from another direction. Sometimes it's hard to see the forest for the trees.
-J
Go to the top of the page
 
rjAccDB
post Mar 23 2011, 12:18 PM
Post#4



Posts: 909
Joined: 16-December 06
From: Phil


Hi J,
Could it be possible to include also a A2003 version, please.
Thank you very much in advance.
rj
Go to the top of the page
 
jhcarrell
post Mar 23 2011, 02:12 PM
Post#5



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


I will try to include both 2003 and 2007 examples in upcoming posts.
Thanks.
- J
Go to the top of the page
 
jhcarrell
post Mar 24 2011, 03:27 PM
Post#6



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Main changes with this version are related to the default workspace form.
added users to include one for each access level. Password for all users is "test".
Oalso edited frmLogin to not require a password for "Guest" users (userAccessLevel = 4).
frmDesktop
====================
In the event that calls clsDesktop, I've made defaultworkspace select a specific form based on the current user's AccessLevel upon opening frmDesktop.
cmdHome has been edited to target a specific form on click based on the current user's AccessLevel.
txtTime - I added this locked text box as an example of having an active clock on a form.
Enjoy.
- J
Attached File  SideMenuInterface_v02.zip ( 856.69K )Number of downloads: 1033
Go to the top of the page
 
jhcarrell
post Mar 29 2011, 12:30 PM
Post#7



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


I've added a basic method of changing the current user's password.
rmUserPasswordChange is launched from the "User Main Menu" side menu.
It asks for the user to enter their current password, new password, and confirm new password.
1. The current password is matched to the password of the current user.
This is one reason for the following from my original post:
2. The new password is checked against the current password to prevent reusing the same one back-to-back and checked for length (in my example pw is required to be eight characters).
3. If the confirmation password matches, the user's password is changed.
There are several ways I've considered to further modify this; such as force password reset after expiration is reached (x days since pw was last changed), but felt the above was adequate for this example.
Enjoy.
- J
Attached File  SideMenuInterface_v03.zip ( 921.52K )Number of downloads: 636
Go to the top of the page
 
originalread
post Mar 29 2011, 04:54 PM
Post#8



Posts: 13
Joined: 22-February 11



This is what I came up with for a solution to the dynamic user access problem. Basically, it works by case 1 being admin, case 4 being guest and case else should capture everything else other then guest. New access levels would be less privileged then the last level. A future improvement would be to stop using the primary key of the access level table and use a different field as the UserAccessLevel.
div class='codetop'>CODE
Public Property Get GroupSourceSQL() as String
Select Case UserAccessLevel
Case 1
GroupSourceSQL = "SELECT * " & _
"FROM " & GroupTable & " " & _
"WHERE Active = True " & _
"AND MenuItemParent = 0 " & _
"ORDER BY MenuItemOrder;"
Case 4
GroupSourceSQL = "SELECT * " & _
"FROM " & GroupTable & " " & _
"WHERE MenuItemAccess = " & UserAccessLevel & " " & _
"AND Active = True " & _
"AND MenuItemParent = 0 " & _
"ORDER BY MenuItemOrder;"
Case Else
GroupSourceSQL = "SELECT * " & _
"FROM " & GroupTable & " " & _
"WHERE MenuItemAccess >= " & UserAccessLevel & " " & _
"AND MenuItemAccess <> 4 " & _
"AND Active = True " & _
"AND MenuItemParent = 0 " & _
"ORDER BY MenuItemOrder;"
End Select
End Property

First Post! Guess I needed to stop lurking eventually.
Go to the top of the page
 
jhcarrell
post Mar 30 2011, 06:49 AM
Post#9



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Welcome to UA!
welcome2UA.gif
I've considered this as well and agree.
Go to the top of the page
 
cocoflipper
post May 11 2011, 05:35 PM
Post#10



Posts: 1,175
Joined: 11-August 03
From: Denver - CO


An excellent UI. I've been toying around with moving completely to A2007 and .accde as the format for my application, but I could not get over utilizing the ribbon instead of the command bars. The main issue was not the ribbon itself (although, I have to say that the ribbon takes up way too much space), it was all the additional "stuff" that the MS Access team gave us no good way of removing in order to make a clean, professional-looking application. Specifically, I'm talking about the following:
- the Office Button
- the QAT (Quick Access Toolbar)
- the Help button
- the minimize and close thingys
- finally, the strange Access icon that would completely remove my main form
All the culprits are displayed on the image I've added to this post
After trolling the internet and UtterAccess, and reading some prior posts, I learned that I could remove everything with the following line:
CODE
DoCmd.ShowToolbar "Ribbon", acToolbarNo

Great! This got rid of all the "stuff"....BUT - now any custom menus I had are no longer usable (they no longer appear because I hid the ribbon). Rather than rewrite a lot of code using tabbed windows (as this post suggests), I was looking for a solution that would allow me to keep some of the functionality I have, yet allow me the flexibility of having a top menu area that's accessible at any menu.
The only downside I see to this is that forms and reports allow you to adjust command bar and ribbon menus, so you can adjust the menu across the top to display different items with forms or reports. This is something I'll have to address if I put this in place.
Thanks for posting it - looks great.
Go to the top of the page
 
JessicaZ
post May 29 2011, 04:32 PM
Post#11



Posts: 175
Joined: 26-March 08
From: St. Paul , MN, USA


I added a little code to open the form in the workspace in add mode -

under Private Function OpenItem....after this code..
CODE
    
                Case -1       'Open in Workspace (-1)
                Form.Parent.sfrmWorkspace.SourceObject = strTarget
                Form.Parent.sfrmWorkspace.Form.Filter = strWhereCondition
                Form.Parent.sfrmWorkspace.Form.FilterOn = True
                Form.Parent.Caption = strMenuItemText       'Nz(Forms(strTarget).Caption, "No Caption")

added this..
CODE
                If strArguments = "acAdd" Then
                    ' go to new rec
                    Form.Parent.sfrmWorkspace.SetFocus
                    DoCmd.GoToRecord , , acNewRec
                End If

So in the side menu admin, when I want to open one of the child menu items in a workspace, but in "Add" mode, I just put acAdd in the arguments area. Works so far anyway!
Go to the top of the page
 
cocoflipper
post Jun 8 2011, 12:15 PM
Post#12



Posts: 1,175
Joined: 11-August 03
From: Denver - CO


Hi all,
've playing around with this menu, here and there, when I get time. I thought I'd post some edits that I made to the menu that would help a developer who needed this menu for Access 2007 (and perhaps Access 2010, but I have not tested the attached on 2010).
THere are my changes to functionality and code:
- Added Icon on main menu (circling arrow - on admin menu only) which allows a developer to view application as a standalone app or with nav pane /ribbon for development work. Procedures for this are found in a module called PhilCode.
- Clicking again on side menu bar rolls up all menu items (something I saw on other similar side window functionality – Outlook - that I liked). Revised line in clsSideMenu to change GroupCoverX_Click procedures to add this functionality.
- Added option in child submenu to allow menu items to run code (public functions that you would have in a module), with multiple parameters. This may need work , as the limit is currently 10 arguments (which I thought was enough), and there is really no catch to what arguments you enter into the child window (although, the arguments are listed right above for reference). Added table (tblSideMenuProcs), form (frmSideMenuAdminProc), and some additional procedures in PhilCode. Added an example called “Run Function X” to give an idea of the functionality.
- other edits to clsResize, m_Form_Resize code to make sure that when switching between developer view that interior form would be maximized.
One thing that I was not able to address – the brief flash of the Navigation Pane upon starting up the database. I unchecked “Display Navigation Pane” in Access Options / Current Database, to try to make sure it does not display during startup/login, but that still doesn’t seem to stop the pane from briefly displaying. Anyone have any ideas?
There’s a bunch of debug.print lines that can be deleted eventually (I was using those to try and track down some issues with resizing).
HTH.
Attached File(s)
Attached File  SideMenuInterface_v03_a2007_PhilEdits.zip ( 626.29K )Number of downloads: 549
 
Go to the top of the page
 
JessicaZ
post Jun 8 2011, 02:16 PM
Post#13



Posts: 175
Joined: 26-March 08
From: St. Paul , MN, USA


I have a question about the calendar function in the Side Menu -- Maybe someone can point me in the right direction?
Ocreated an imput form that is linked to training sessions, Usually there is only one session on any given date though occasionally there may be 2 sessions (different session types) that fall on the same date. How the PutinData funtion is coded now it will only enter the first session in the calendar. Can anyone give me an idea of how I might be able to change it to add 2 sessions if I needed to?
urrent code:
CODE
Public Sub PutInData()
    Dim strSQL As String
    Dim rs As dao.Recordset
    Dim i As Integer
    Dim myDate As Date
    
'Empty out the previous month
    For i = 1 To 37
        Me("text" & i) = Null
        Me("text" & i).BackColor = 14211288
    Next i
    
'Construct a record source for the month
    strSQL = "SELECT refSessionType.SessionType, tblSessions.SessionDate FROM tblSessions LEFT JOIN refSessionType ON tblSessions.SessionTypeID = refSessionType.SessionTypeID WHERE ((MONTH(SessionDate) = " & Me.cboMonth & "  AND YEAR(SessionDate)= " & Me.cboYear & ")) ORDER BY SessionDate;"
    Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
    
'Populate the calendar
    If rs.RecordCount > 0 Then
        For i = 1 To 37
            If IsDate(Me("date" & i)) Then
                myDate = Format((Me("date" & i)), "m/d/yyyy")
                rs.FindFirst "SessionDate = #" & myDate & "#"
                If Not rs.NoMatch Then
                    Me("text" & i) = rs!SessionType
                    Me("text" & i).BackColor = 8978431
                Else
                    Me("text" & i).BackColor = 14211288
                End If
            End If
        Next i
    End If
    
    Set rs = Nothing
End Sub

thanks!
Go to the top of the page
 
jhcarrell
post Jun 8 2011, 06:43 PM
Post#14



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Nice work!
xample of code change made by Phil:
CODE
Private Sub m_GroupCover02_click()
    If m_ActiveGroup = 2 Then UpdateActiveGroup m_GroupCount Else UpdateActiveGroup 2

The above rolls to the bottom available parent group.
If you'd rather it roll back to the top "default" parent group you could use the following:
CODE
Private Sub m_GroupCover02_click()
    If m_ActiveGroup = 2 Then UpdateActiveGroup 1 Else UpdateActiveGroup 2

By replacing "m_GroupCount" with "1" you will be taken back to the top menu instead.
If you'd like to roll to the parent group directly above or below the current one you could change the "Then UpdateActiveGroup" to a digit higher or lower than the current group as desired.
Ohaven't had a chance to take a hard look at the other modifications you've added, but will chime back when I do.
-J
Go to the top of the page
 
jhcarrell
post Jun 9 2011, 09:10 AM
Post#15



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


I resolved this by moving your "RemoveRibbon()" function call from the OnClick event to the BeforeRender event of frmDesktop and frmLogin. This was tested with Access 2007.
J
Go to the top of the page
 
cocoflipper
post Jun 15 2011, 04:48 PM
Post#16



Posts: 1,175
Joined: 11-August 03
From: Denver - CO


Never mind - found the answer:
o load images into the imagelist control
- right-click the imagelist
- select ImageListCtrl Object
- select Properties
- on the Images tab, upload images to the imagelist so that you can then use them within the menu
Go to the top of the page
 
jhcarrell
post Jun 16 2011, 08:18 AM
Post#17



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


That is correct on loading new images.
Is far as user specific images for menu items, please provide details on what you're wanting to accomplish. As it is now, the icons are specific to the menu item and the settings are stored in tblSideMenuItem.
Go to the top of the page
 
jhcarrell
post Jun 20 2011, 06:17 PM
Post#18



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


This update should completely replace v04 and v05.
ignificant Changes:
- I corrected the coding for a previously mentioned issue regarding the positioning of group items. This was accomplished by modifying the following:
clsSideMenu - Private Sub m_Form_Resize()
clsSideMenu - Public Function UpdateActiveGroup(intGroup As Integer)
- I also hard coded gradient colors to identify the active group. I plan to make this a feature that can be edited using the SideMenuAdmin form, but wanted to give a preview of the direction I'm going. This was accomplished by modifying the following:
clsSideMenu - Public Function UpdateActiveGroup(intGroup As Integer)
Feedback is welcomed.
Enjoy.
- J
Attached File  SideMenuInterface_v06_a2007.zip ( 586.78K )Number of downloads: 791
Go to the top of the page
 
NigelShaw150
post Jun 28 2011, 06:03 PM
Post#19


Utterly Banned
Posts: 224
Joined: 15-February 11



Hey
I have been working on the splitter bar. I can get thev2 main forms to work but the sub forms on the side menu seem to go a bit too deep. I think there are 3? The splitter works by taking the size of the main form and dividing it between the otherv2 forms thus when you move the splitter, the resize event is triggered by the mouse own even of the bar and recalculates the 2 sub form sizes.
The problem at the minute arises as the side bar has a few sub forms that all need to change size at the same time.
To be fair, I've given it about an hour but, can the side bar have less subforms or am I not looking at it right?
Cheers <
Nige
Go to the top of the page
 
jhcarrell
post Jun 28 2011, 07:59 PM
Post#20



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


I believe you will find that the key to making the splitter bar work is by making the itempane's (subform of the ctlSideMenu) width dependant on the width of ctlSideMenu. You will also need to make the controls' (groups and groupcovers) width dependant on the width of ctlSideMenu.
Go to the top of the page
 
6 Pages V  1 2 3 > » 


Custom Search


RSSSearch   Top   Lo-Fi    18th August 2019 - 05:04 PM