G
Guest
Hello All.
Hope you are having a good easter, unfortunatly i have a project to deliever
by tuesday and i need a little help.
I have a table called tblUsers, which contains all user info needed for
access to the DB. I have a form which is linked to this called frmUserAdmin,
which is the front end i intend to use to manage all user info.
I have control buttons on the bottom (in the form footer) cmdFirst, cmdPrev,
cmdNext, cmdLast, cmdAdd and cmdExit.
I have other buttons on other forms which will open the frmUserAdmin. What i
want to do is control which of the command buttons are available to the user
based on how the frmUserAdmin is used. I.e. if i want to add a user i have a
button which opens the from in add mode. As such i want to disable the next,
prev, first and last record navigation buttons, so the user only has the
option to add a new user. Likewise i have another button on another from
which will open frmUserAdmin in read only mode, where i want them to have
access to all command buttons except cmdAdd (so they cant add people). I hope
this makes sence.
Here is the snipet of code i am using,
Private Sub cmdAddUserAdmin_Click()
On Error Goto Err_cmdAddUserAdmin_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmUserAdmin"
DoCmd.OpenForm stDocName, , , stLinkCriteria
**See Below***
Exit_cmdAddUserAdmin_Click:
Exit Sub
Err_cmdAddUserAdmin_Click:
MsgBox Err.Description
Resume Exit_cmdAddUserAdmin_Click
End Sub
** Now i have tried the following to hide the cmdAdd,
1. Me!cmdAdd.Visible = False
2. Me!cmdAdd.Enabled = False
I know i could create 2 forms, one for adding and one for viewing but i know
this can be done in code. Please help.
Kind regards
Hope you are having a good easter, unfortunatly i have a project to deliever
by tuesday and i need a little help.
I have a table called tblUsers, which contains all user info needed for
access to the DB. I have a form which is linked to this called frmUserAdmin,
which is the front end i intend to use to manage all user info.
I have control buttons on the bottom (in the form footer) cmdFirst, cmdPrev,
cmdNext, cmdLast, cmdAdd and cmdExit.
I have other buttons on other forms which will open the frmUserAdmin. What i
want to do is control which of the command buttons are available to the user
based on how the frmUserAdmin is used. I.e. if i want to add a user i have a
button which opens the from in add mode. As such i want to disable the next,
prev, first and last record navigation buttons, so the user only has the
option to add a new user. Likewise i have another button on another from
which will open frmUserAdmin in read only mode, where i want them to have
access to all command buttons except cmdAdd (so they cant add people). I hope
this makes sence.
Here is the snipet of code i am using,
Private Sub cmdAddUserAdmin_Click()
On Error Goto Err_cmdAddUserAdmin_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmUserAdmin"
DoCmd.OpenForm stDocName, , , stLinkCriteria
**See Below***
Exit_cmdAddUserAdmin_Click:
Exit Sub
Err_cmdAddUserAdmin_Click:
MsgBox Err.Description
Resume Exit_cmdAddUserAdmin_Click
End Sub
** Now i have tried the following to hide the cmdAdd,
1. Me!cmdAdd.Visible = False
2. Me!cmdAdd.Enabled = False
I know i could create 2 forms, one for adding and one for viewing but i know
this can be done in code. Please help.
Kind regards