Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    19

    Unanswered: run time error 3464, Data type mismatch in criteria expression

    run time error 3464, Data type mismatch in criteria expression

    Hi who can me help me out with this problem?

    I get the above error if I run this Dlookup.
    The colum RelationID comes out of an oracle table and the data type is Number.

    Both nummer and sDataEntryUser are Variant

    nummer = Me.txtRelationID
    sDataEntryUser = DLookup("[Data_Entry_User]", "Relations", "[RelationID] =" & "'" & nummer & "'")

    The funny thing is (well not so funny), nummer returns a number. If I put this number instead of the nummer in the Dlookup it gives me the information needed.

    What might it be.

    Many thankx in advanced.

  2. #2
    Join Date
    Nov 2004
    Posts
    64
    nummer = Me!txtRelationID
    'if nummer is text it would be like so
    xx = DLookup("[textfield1]", "table1", "[TextField2]='" & nummer & "'")

    'if nummer is integer it would be like so
    'xx = DLookup("[Field1]", "table1", "[Field2]=" & 5)

    Me![FieldOnForm] = xx

    cheers

    Peter.T

    if its not to much trouble ymay be you could lit me know if it works

  3. #3
    Join Date
    Nov 2004
    Posts
    64
    it was late last night when I typed in my previous post, I have made some alteration just to tidy up the code

    nummer = Me!txtRelationID
    'for text values use this code
    xx = DLookup("[textfield1]", "table1", "[TextField2]='" & nummer & "'")

    'for integer/number values use this code
    xx = DLookup("[textfield1]", "table1", "[RelationID]=" & nummer)
    Me![ sDataEntryUser] = xx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •