Solved Hide button or Icon need to arrange by automatic (1 Viewer)

smtazulislam

Member
Local time
Today, 19:03
Joined
Mar 27, 2020
Messages
806
In my dashboard Tools need to arrange when we hide button for some user. But here these place is empty display.
I would like it automatically arrange when hide icon or button not gap or blank.
Can It possible.

All arrange icon and button by stacked.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:03
Joined
May 7, 2009
Messages
19,246
you need to "relocate" the Visible Buttons to the place of the "Hidden" buttons, just
to Remove the "gap" on each buttons.
 

isladogs

MVP / VIP
Local time
Today, 17:03
Joined
Jan 14, 2017
Messages
18,254
Yes it can be done but an easier approach might be to disable the buttons instead of hiding them
 

smtazulislam

Member
Local time
Today, 19:03
Joined
Mar 27, 2020
Messages
806
you need to "relocate" the Visible Buttons to the place of the "Hidden" buttons, just
to Remove the "gap" on each buttons.
Not working when I use the picture
Edit :
can possible to automatically remove gap..
 

Attachments

  • Capture.JPG
    Capture.JPG
    115.4 KB · Views: 63
Last edited:

smtazulislam

Member
Local time
Today, 19:03
Joined
Mar 27, 2020
Messages
806
Yes it can be done but an easier approach might be to disable the buttons instead of hiding them
I tried it, its worked. But problem is picture can't disable...
Look at picture : Post@ 4

Edit :
Can give any way to if user click picture then form not open. cause, I can't find any ways to disabled picture.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:03
Joined
May 7, 2009
Messages
19,246
here is a demo of what i meant.
not so hard (complicated) after all.
 

Attachments

  • HideButtonBasedOnUser.accdb
    828 KB · Views: 96

smtazulislam

Member
Local time
Today, 19:03
Joined
Mar 27, 2020
Messages
806
here is a demo of what i meant.
not so hard (complicated) after all.
I tried it. its worked. See post #5
But each command I have separated top a picture/Icon. Picture is not with same Button. It is need separated.
I also tried to same button but same I can't find SIZE MODE OPTION. can you give a demo with picture.
 

smtazulislam

Member
Local time
Today, 19:03
Joined
Mar 27, 2020
Messages
806
Tools image hide option is SOLVE.

Now I facing another problem.
This is for Dashboard Tools by condition each user. Its perfectly worked.
Code:
StrUserRole = DLookup("UserRolesID", "Users", "UserName='" & TempVars("UserName") & "'")
Select Case StrUserRole
        Case 1 'admin
            Me.lbAddEmployee.Enabled = True
            Me.lbEditEmployee.Enabled = True
            Me.lbSearchEmployee.Enabled = True
            Me.lblViewAll.Enabled = True
            Me.lbTransferEmployee.Enabled = True
            Me.lbUpdatePassport.Enabled = True
            Me.lbStopSalary.Enabled = True
            Me.lbAddVacation.Enabled = True
            Me.lblFinalExit.Enabled = True
            Me.lbReports.Enabled = True
            Me.lbTranslator.Enabled = True
            Me.lbAdminPanel.Enabled = True
            Me.lbUtilityPanel.Enabled = True
        
        Case 2 'manager
            Me.lbAddEmployee.Enabled = True
            Me.lbEditEmployee.Enabled = True
            Me.lbSearchEmployee.Enabled = True
            Me.lblViewAll.Enabled = True
            Me.lbTransferEmployee.Enabled = True
            Me.lbUpdatePassport.Enabled = False
            Me.lbStopSalary.Enabled = False
            Me.lbAddVacation.Enabled = True
            Me.lblFinalExit.Enabled = False
            Me.lbReports.Enabled = True
            Me.lbTranslator.Enabled = True
            Me.lbAdminPanel.Enabled = False
            Me.lbUtilityPanel.Enabled = True
        
        Case 3 'payroll
            Me.lbAddEmployee.Enabled = False
            Me.lbEditEmployee.Enabled = False
            Me.lbSearchEmployee.Enabled = True
            Me.lblViewAll.Enabled = True
            Me.lbTransferEmployee.Enabled = False
            Me.lbUpdatePassport.Enabled = False
            Me.lbStopSalary.Enabled = True
            Me.lbAddVacation.Enabled = False
            Me.lblFinalExit.Enabled = False
            Me.lbReports.Enabled = False
            Me.lbTranslator.Enabled = True
            Me.lbAdminPanel.Enabled = False
            Me.lbUtilityPanel.Enabled = False
End Select

I have a dashboard for 3 Users. In dashboard 4 lists box where condition that double click to open main form.
So, I need some condition by Each user that If he/she click this list box and he/she does not able to EDIT Or ADD any data.

I TRIED to Disabled list box, but user give complain then she need to see data sometime.
Question :
Where I have to put these condition.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:03
Joined
Feb 19, 2002
Messages
43,408
To allow a user access to a record but not allow updates, use the form's BeforeUpdate event. Since the user is opening a separate form, the code needs to go into the form the user opened, not the dashboard form.

Code:
If "somecondition indicating that the user does NOT have access" Then
    msgbox "You do not have permission to update this record.", vbOKOnly
    Me.Undo  '' back out all changes to the record.
    Cancel = True   '' Tell Access to not save the changes
    Exit Sub
End If

.....

Do the rest of your validation to determine if there are any errors.
 

smtazulislam

Member
Local time
Today, 19:03
Joined
Mar 27, 2020
Messages
806
To allow a user access to a record but not allow updates, use the form's BeforeUpdate event. Since the user is opening a separate form, the code needs to go into the form the user opened, not the dashboard form.

Code:
If "somecondition indicating that the user does NOT have access" Then
    msgbox "You do not have permission to update this record.", vbOKOnly
    Me.Undo  '' back out all changes to the record.
    Cancel = True   '' Tell Access to not save the changes
    Exit Sub
End If

.....

Do the rest of your validation to determine if there are any errors.
Thank you. I take it another processing by Command Button. By Some Icon from website. Fixed it
 

Users who are viewing this thread

Top Bottom