Que tal, quiero restringir el acceso a ciertos botonesque ejecutan funciones
Cree esta funcion de ejemplo en un modulo
Código:
Public Sub Acceso_system()
If not frmAcceso.txtUser = "admin" Then
MsgBox "No puede acceder a esta opcion"
Exit Sub
End If
End Sub
Pero no ejecuta el exit sub al llamarla desde cualquier form, solo envia el mensaje y continua, no detiene su ejecucion
Si pongo todo el codigo antes de ejecutar cualquier otra funcion si ejecuta el exit sub por ejemplo
Código:
Case 1
'Eliminar registro
If not frmAcceso.txtUser = "admin" Then
MsgBox "No puede acceder a esta opcion"
Exit Sub
End If
F_eliminar
Case 2
'Modificar registro
F_modificar