Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Nov 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup (Access 2000)

    I have aproblem with the DLookup since i want to find not all the Dentists but only the last one.The field Dentist is a Yes/No field and in the table Doctors there are several fields Dentist described as True.
    How can i reformu;ate mu DLook up question ?

    If DLookup("Dentist", "Doctors") = True Then
    FncVisits
    End If

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DLookup (Access 2000)

    How do you determine which record is the last one? Is there an AutoNumber field or a date field that can be used for this purpose? If so, what is its name?

  3. #3
    New Lounger
    Join Date
    Nov 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup (Access 2000)

    Thanks a lot. The table Doctors has an Autonumber field called Doctorid.For example DoctorId = 3 has the field Dentist set to Yes. But also Doctorid = 23 has also a field dentist set to Yes.So the last doctor having dentist = Yes is Doctor Nr 23

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DLookup (Access 2000)

    OK. What exactly do you want to do?

  5. #5
    New Lounger
    Join Date
    Nov 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup (Access 2000)

    My line If DLookup("Dentist", "Doctors") = True Then
    does not look up for the last doctor in the table Doctors with dentist = true
    I should write somewhere last ot dmax os else ?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DLookup (Access 2000)

    It's not clear what you want to do. If you look up the last record in the table for which Dentist = True, the result of DLookup will by definition be True. So I think you mean something else.

Posting Permissions

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