Results 1 to 7 of 7
  1. #1
    StuartR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Scotland
    Posts
    46

    Question Inserting the entered date from a field in one form to a similar field in another form / table

    Can anyone advise me the best way to do this please ...

    I have a members_table with a one to many link to a subscription_table. The subscription table records all payments received from all members. I want however to save the latest_payment_date for any member so that I can track which members are overdue with their subscriptions



    I did think about having a field on the members table which would hold the date of the last_payment_made, with this field being over-written / updated by any payment made by that member in the subscription table / data entry form. I have however not managed to achieve this.

    I was then going to run a query to list members who have not paid for more than 1 year, (ie in arrears with their subscription) but I am sure there will be a more efficient way of achieving this. Access 2016 may even have a standard solution to this of which I am unaware.

    Any help or guidance will be appreciated.

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Might try using DMax function to get the last date per member, then display that on the main form.

    DMax("[Last_Payment_Made]", "Yourtable", "[MemberID] = " & Me.MemberID)

    If you want to check it for overdue maybe for 6 months:

    If DateAdd("m",6,DMax("[Last_Payment_Made]", "Yourtable", "[MemberID] = " & Me.MemberID)) > Date() then me.Overdue = "Overdue"

  3. #3
    StuartR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Scotland
    Posts
    46
    Thanks Bulzie

    I'm not too sure where you are suggesting I insert the DMax function.

    Stuart

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    You can create a field on the Main form and in the Control Source add =DMax("[Last_Payment_Made]", "Yourtable", "[MemberID] = " & Me.MemberID)



  5. #5
    StuartR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Scotland
    Posts
    46
    Getting there I think, but not quite there yet ...

    Actual Table & Field names are ...

    Member_Names with Member_ID field with one to many relationship with MemberIDFK field on Income table
    Member_Names table has a field called Last_Payment

    I created a table called Member_Names_DateTest which has a control for the Last_Payment field

    I inserted the following code using the Expression Builder into the Control Source for this ...

    =DMAX("[Date of Payment]","Income","[MemberIDFK] = " & Me.Member_ID)

    This is accepted as not having any errors, but when you view the Member_Names_DateTest form the Last_Payment field shows #Name?, and not the required last date.

    Hope you can follow this, and thanks for your help.

    PS Is the problem perhaps to do with the fact that we are searching for and passing Dates, and not text, and does this affect the " " etc. ???
    Last edited by StuartR; 07-27-2017 at 02:07 PM. Reason: Further thought ...

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Try: =DMAX("[Date of Payment]","Income","[MemberIDFK] = Forms.formname.Member_ID")

  7. #7
    StuartR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Scotland
    Posts
    46
    Success ~ That did it. Thanks for your help aytee111 and Bulzie. Much appreciated.

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

Similar Threads

  1. VBA to append date entered from a Form field
    By Sephaerius in forum Modules
    Replies: 2
    Last Post: 04-03-2017, 08:28 AM
  2. Replies: 10
    Last Post: 04-03-2016, 08:36 PM
  3. Replies: 3
    Last Post: 06-23-2015, 02:40 PM
  4. Replies: 10
    Last Post: 03-04-2015, 01:32 PM
  5. Replies: 1
    Last Post: 03-03-2012, 10:17 PM

Tags for this Thread

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