Cree esta funcion de ejemplo en un modulo
Código:
Pero no ejecuta el exit sub al llamarla desde cualquier form, solo envia el mensaje y continua, no detiene su ejecucionPublic Sub Acceso_system() If not frmAcceso.txtUser = "admin" Then MsgBox "No puede acceder a esta opcion" Exit Sub End If End Sub
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