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

    Question Best way to put "Calculated" Variable text on a form

    What is the best way to show text that can vary depending on conditions on a form

    To explain ...

    I have a form with an unbound box which shows the result of the following DMAX expression

    =DMAX("[Date of Payment]","Income","[MemberIDFK] = Forms.formname.Member_ID")

    This successfully shows the date of the most recent payment from a member.



    I want to show text next to this box which states whether the members payments are up to date or overdue etc.

    ie ..

    if today's date - DMAX is less than 365 days the text would read "Paid Up to Date" (or something similar)
    if todays date - DMAX is more than 365 days but less than (say) 450 the text would read "Subs Due"
    if todays date - DMAX is more than 450 and less than (say) 730 the text would read "Over Due"
    if today's date - DMAX is more than 730 the text would read "Lapsed"

    Do I need to repeat the DMAX calculation, or can I just get the date of the last payment from the original unbound box which is a text box named Last_Payment

    Ideally, I would also like to format the text colour to show the status / urgency of the payment situation. Presumably this can be done with Conditional Formatting.

    Any help regarding the best way to achieve and show the variable text would be appreciated

    Cheers

    Stuart

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Should be able to reference textbox Last_Payment in another textbox expression. Have you tried?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    StuartR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Scotland
    Posts
    46
    Yes been trying things like that but I think my syntax is wrong ...

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    And what have you tried ...

    Consider:

    In a textbox [tbxDiff] calculate the difference between dates: = Date() - [LastPayment]

    Then in another textbox:
    = Switch([tbxDiff]<=365, "Current", [tbxDiff]<=450, "Subs Due", [tbxDiff]<=730, "Overdue", True, "Lapsed")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

    Success

    That Did it ~ Thanks June7

    Your help is much appreciated.

    Stuart

    Quote Originally Posted by June7 View Post
    And what have you tried ...

    Consider:

    In a textbox [tbxDiff] calculate the difference between dates: = Date() - [LastPayment]

    Then in another textbox:
    = Switch([tbxDiff]<=365, "Current", [tbxDiff]<=450, "Subs Due", [tbxDiff]<=730, "Overdue", True, "Lapsed")

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

Similar Threads

  1. Replies: 6
    Last Post: 02-11-2016, 02:05 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 3
    Last Post: 07-19-2014, 01:15 PM
  4. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  5. Replies: 1
    Last Post: 04-25-2011, 12:36 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