Added: 1 year ago
From: benmarch10
Views: 8,793
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (18)

Sign In or Sign Up now to post a comment!
  • why i become the error " Data type mismatch in criteria expression" ?? any help plz??

  • Microsoft Access Tips for Casual Users

    Getting a value from a table: DLookup()'

    Can't link to it though

  • This is a great step by step. I don't know if it's because I had a different version of Access or because the fields I was working with were text fields but that expression didn't work for me.

    I found the code that did work at an allen browne site

    This is what I ended up with: CourseName = DLookup("CourseName", "Primary", "CourseID = '" & [CourseID] & "'")

    This walk through is still appreciated, it got me on the right track using the right language to figure this out!

  • This did not work after 3 attempts from scratch. It would be nice to know how your relationships are setup.

    (Runtime error)

  • Hi @AllsiteMadison, sorry I don't still have this database, but I'll see if I can recreate this and supply it for people to reference.

  • @AllsiteMadison I have updated the description of my video to include a link to a sample database which has this functionality. You should be able to download it and run it on your computer. Its in Access 2010.

  • @benmarch10 why i become the error " Data type mismatch in criteria expression" ?? any help plz??

  • Thank you that confused this shit out of me..

  • 2 thumbs up!!! this is exactly what I am looking for!!! problem oriented Solution!!!!!

    I will be camping on your channel!!! keep thems videos coming

  • HELP!!!

    I tried to do what you did in the video and I am getting an error message:

    The followings is my code: I am trying to link Student# to Student Name. I did the event in the Student# as in the video - the StudentName is in the StudentRecords Table

    Private Sub StudentName_BeforeUpdate()

    StudentName = DLookup("StudentName", "StudentRecords", "Student#=" & Student#)

    End Sub

    The error message I get is: Run-time error '3075'

    Syntax error in date in query expression 'Student#=0'.

    HELP!

  • @No1momof3 I'm guessing that you are getting that error because of the # sign in your Student# column name. Try changing your DLookup statement to include square brackets around the student# column name. Try the following statement and let me know how it works...

    StudentName = DLookup("StudentName", "StudentRecords", "[Student#]=" & Student#)

  • @benmarch10

    thanks Ben I did exactly as you said:

    Private Sub Student__AfterUpdate()

    StudentName = DLookup("StudentName", "StudentRecords", "[Student#]=" & Student#)

    End Sub

    the error message is now: Runtime error 3464 Data type mismatch in criteria expression.

    I know I am struggling but I REALLY want to learn access and these youtube videos are great and I have picked up a lot

  • I love this. It's great but you can't see your characters so it's hard to duplicate. Will you please provide the formula? Thank you!

  • Hello @tmkm130 , sorry for the delay in getting back to you. Here is the formula I used. Hope this helps!

    Private Sub PartNumber_AfterUpdate()

    Desc = DLookup("Description", "Item", "PartNumber=" & PartNumber)

    End Sub

  • Thanks for sharing this informative Video. For Expert Level .NET Video's visit "TheSYNERGETICS" channel on youtube . Synergetics is Awarded as the Best. NET Training Service Provider by Microsoft

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more