Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dlookup Assistance (Access 2003)

    I am trying to use a lookup table to prevent user's from entering certain data.

    Table1
    tblMainTable
    FirstName
    LastName
    DOB
    Etc

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

    Re: Dlookup Assistance (Access 2003)

    Try this:
    <code>
    If DCount("*", "tblDisenroll", "LastName = " & Chr(34) & Me.txtLastName & Chr(34) & _
    " AND DOB =#" & Format(Me.txtDOB, "mm/dd/yyyy") & "#") > 0 Then
    MsgBox "This combination of last name and date of birth is not allowed.", vbExclamation
    ...
    End If</code>

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dlookup Assistance (Access 2003)

    Works just perfectly Hans.

    Thank you so much. I really appreciate your generosity.

    Michael

Posting Permissions

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