Results 1 to 4 of 4
  1. #1
    pcandeias0 is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    2

    Dlookup


    Hello,

    Anyone could help me with this code. it gives me run-time error 3075 and syntax error missing operator. field cartão is string and Text 105 is the name of control.

    Private Sub Text105_Exit(Cancel As Integer)

    If Not IsNull(DLookup("[Cartão]", "cartoes", "[Cartão]=" & Me!Text105 & "")) Then

    MsgBox "Já existe(m) ação(ões) sobre este cartão. confirme em histórico.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"

    End If
    End Sub


    Thanks in advance

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try adding the single quotes:
    If Not IsNull(DLookup("[Cartão]", "cartoes", "[Cartão]= '" & Me!Text105 & "'")) Then

  3. #3
    pcandeias0 is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    Now it function

    Best regards

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Dlookup help
    By jcaptchaos2 in forum Access
    Replies: 17
    Last Post: 04-21-2011, 01:33 PM
  2. DLookup
    By neil45156 in forum Forms
    Replies: 1
    Last Post: 04-11-2011, 11:31 AM
  3. Need help with dlookup.
    By Keith in forum Database Design
    Replies: 8
    Last Post: 05-24-2010, 06:28 PM
  4. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 AM
  5. Dlookup
    By janjan_376 in forum Access
    Replies: 20
    Last Post: 07-07-2009, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums