Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking up a date from another table (Access 2000 Sr-1)

    Kellye,

    Put a relation between the two tables based on the organization name or the key of organization if you have one and make a query with a selection Is Not Null on the organization from the last year field.
    BTW the attached db is probably on vacation <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>. I don't see any one <img src=/S/broke.gif border=0 alt=broke width=31 height=23>

    Francois
    Francois

  2. #2
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking up a date from another table (Access 2000 Sr-1)

    I tried the relationship thing, but it wasn't working the way I thought it was. I tried adding the database again to the post (I know I did it the first time!), and I just got an internal server error, to try again later. Once I put the database back in the post, if you have a chance to look at it, that would be great. Thanks!

    -Kelley

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking up a date from another table (Access 2000 Sr-1)

    Sorry, still no attachment <img src=/S/nope.gif border=0 alt=nope width=15 height=15>

    Francois
    Francois

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looking up a date from another table (Access 2000 Sr-1)

    I'm working on a database that keeps track of donations. What I'm trying to do is add a field to a form (or table if it's necessary), that will look at an organization name and be able to pull the date and amount that was donation to that same organization the year before. So, if I was entering an amount that was donated in 2000 in the 2000 table/form, I also want to be able to see what was donated to that same organization last year.

    I'm pretty sure it can be done, but I just cannot remember how. I'm also wondering if I need to alter the structure of the database to allow this to happen better. Attached is a copy of the db so far (zipped file, without any relationships).

    Any assistance would be most appreciated.

    -Kelley
    Attached Files Attached Files

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking up a date from another table (Access 2000 Sr-1)

    You didn't give me enough time to get it in there! It should be there now.

    -Kelley

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking up a date from another table (Access 2000 Sr-1)

    Kelley,

    Put this code in the AfterUpdate Event of ID :
    <pre>Private Sub ID_AfterUpdate()
    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    Dim strCriteria As String
    Set db = CurrentDb
    Set rst = db.OpenRecordset("1999 Donations Log", dbOpenDynaset)
    strCriteria = "ID = " & Me!ID
    With rst
    .FindFirst strCriteria
    If Not .NoMatch Then
    Me![Last Year Date] = ![Date of Initial Donation]
    End If
    End With
    End Sub
    </pre>


    In the code window check if the reference to Microsoft DAO 3.6 is checked (Tools | References). I had to add it in your DB.
    I modify your DB2 and try to attache it.

    Success

    Francois
    Attached Files Attached Files
    Francois

Posting Permissions

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