No funciona dlookup

tengo un problema para la creación de un formulario deseo crear una confirmación de usuario y contraseña pero no pude utilizar el dlookup sale un mensaje de error no se admite esta propiedad o método

este es el código

Private Sub BT_INGRESAR_Click()
If Nz(Me.TUSUARIO.Value, "") = "" Then
MsgBox ("Ingrese Usuario"), vbInformation, "CREDIUNO"
Me.AS1.Visible = True
Me.TUSUARIO.SetFocus
Else
If Nz(Me.TPASSWORD.Value, "") = "" Then
MsgBox ("Ingrese Contraseña"), vbInformation, "CREDIUNO"
Me.AS2.Visible = True
Me.TPASSWORD.SetFocus
End If
End If
If Me.Etiqueta8 = DLookup("PASSWORD", "USUARIOS", "USUARIO=" & Me.TUSUARIO) Then
MsgBox ("ESE ES EL US"), vbInformation, "CREDIUNO"
End If
End Sub

mil gracias

Respuesta
1

El error esta en que los campos texto van entre comillas simples

DLookup("PASSWORD", "USUARIOS", "USUARIO= ' " & Me.TUSUARIO & " ' ")

Visita mi blog: http://www-todoaccess.blogspot.mx

mil gracias pero no me funciono lo logre con el siguiente código

Private Sub BT_INGRESAR_Click()
Dim y As Integer
If Nz(Me.TUSUARIO.Value, "") = "" Then
MsgBox ("Ingrese Usuario"), vbInformation, "CREDIUNO"
Me.AS1.Visible = True
Me.TUSUARIO.SetFocus
Exit Sub
Else
If Nz(Me.TPASSWORD.Value, "") = "" Then
MsgBox ("Ingrese Contraseña"), vbInformation, "CREDIUNO"
Me.AS2.Visible = True
Me.TPASSWORD.SetFocus
Exit Sub
End If
End If
If TPASSWORD = DLookup("PASSWORD", "USUARIOS", "USUARIO=Form!TUSUARIO") Then
y = MsgBox("Desea Ingresar Como: " & DLookup("NOMBRES", "USUARIOS", "USUARIO=Form!TUSUARIO") & " " & DLookup("APELLIDOS", "USUARIOS", "USUARIO=Form!TUSUARIO") & vbCrLf & "Tipo De Usuario: " & DLookup("[TIPO DE USUARIO]", "USUARIOS", "USUARIO=Form!TUSUARIO"), vbYesNo, "CREDIUNO")
If y <> 6 Then
Exit Sub
End If
DoCmd.OpenForm "formulario2", acNormal
DoCmd.Close acForm, "ingreso"
Else
MsgBox ("Usuario/Contraseña Incorrecta"), vbInformation, "CREDIUNO"
End If
End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas