Solved Hide button or Icon need to arrange by automatic

smtazulislam

Member
Local time
Today, 05:40
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.
 
you need to "relocate" the Visible Buttons to the place of the "Hidden" buttons, just
to Remove the "gap" on each buttons.
 
Yes it can be done but an easier approach might be to disable the buttons instead of hiding them
 
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: 76
Last edited:
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.
 
here is a demo of what i meant.
not so hard (complicated) after all.
 

Attachments

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.
 
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.
 
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.
 
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

Back
Top Bottom