Results 1 to 4 of 4
  1. #1
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136

    Dlookup

    I am writing a Dlookup in VBA Access based on a table called tblStudents, looking for the job in job column when lastname is aXEN:

    Code:
    dim x as variant
    x = Dlookup(Tables!tblStudents![Job], Tables!tblStudents!tblStudents, Tables!tblStudents![LastName] = "aXEN")
    End Sub
    but I am getting an error saying "Object Required".

    This code is written in a normal module in VBA access called Module1.



    Please advise.

    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    This should help:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136
    thanks! it helped

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Another Dlookup ?
    By Thompyt in forum Programming
    Replies: 10
    Last Post: 11-23-2016, 04:07 PM
  2. Shortening if / dlookup >0 / then dlookup
    By Jack Russel in forum Modules
    Replies: 1
    Last Post: 02-19-2016, 03:01 PM
  3. DLookUp help!!
    By netguy in forum Programming
    Replies: 2
    Last Post: 09-28-2014, 09:44 AM
  4. Should I be using Dlookup
    By parishpete in forum Programming
    Replies: 6
    Last Post: 11-08-2012, 05:39 AM
  5. Help with Dlookup
    By taimysho0 in forum Programming
    Replies: 2
    Last Post: 07-07-2012, 03:55 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