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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Looking up a date from another table (Access 2000 Sr-1)

    Author
    Topic
    #359644

    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 shrug. I don’t see any one broke

    Francois

    Viewing 1 reply thread
    Author
    Replies
    • #539632

      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

      • #539634

        Sorry, still no attachment nope

        Francois

        • #539637

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

          -Kelley

          • #539649

            Kelley,

            Put this code in the AfterUpdate Event of ID :

            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
            

            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

    • #539622

      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

    Viewing 1 reply thread
    Reply To: Looking up a date from another table (Access 2000 Sr-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: