Results 1 to 5 of 5
  1. #1
    Marvo is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    4

    Dynamically create n fields based on user input

    Hi all - hoping you can help....



    I run a charity pre-school and have invoices to send out. Some of the parents cant afford to pay the whole amount in one go, so we give them a payment plan. e.g. If an invoice is for a 6 week term we let them pay weekly. So I have a check box on my form to say "are you on a payment plan".
    Then - I have an free form input box..."How many payments..." and the answer may for instance be '6'.

    What I want to do now is dynamically create/display 6 date fields, to record what the agreed payment dates are.

    but maybe the answer is 4, or 7, etc. So I need to create/display the correct number of payment date fields. And I'm just not that clever!

    Thanks for your assistance
    M

  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,928
    That is not a practical approach. To even try to accomplish would involve VBA that modifies table/form/report design.

    What you can maybe do is have a fixed number of textboxes (maybe 10) on form/report and then expression in each textbox calculates a value based on the payment plan.
    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
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I agree that your approach is questionable. I recommend you define what you are trying to do, build a model and do some testing before getting into the nuts and bolts of Access. You need a plan -something you can describe in plain English.
    Instead of thinking -- I need "...create/display the correct number of payment date fields..",(spreadsheet ) I suggest you adjust to Payment, PaymentDate with a record for each Payment(database).
    You know the details better than readers do.
    Good luck.

  4. #4
    Marvo is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    4
    Thanks chaps. Have gone with the fixed number of textboxes approach for payment dates and a datasheet subform to record the payments.
    I was trying to make the system foolproof for non IT minded folks. If there are only 6 payments I wanted to make sure they don't put in 7 payment dates! Would be nice to dynamically create the right number of boxes but never mind. Thanks for your input and help.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    You could have a main form for the person who owes with a subform that you limit to n records. I have done this with a bill of lading form that had the main data plus a subform datasheet that I needed to limit to a maximum of 6 rows. I think this approach is more normalized than what you are doing (the subform details were in a separate table). You could even control the number of subform rows using a control on the main form.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-04-2014, 12:07 PM
  2. Replies: 1
    Last Post: 10-30-2014, 10:11 AM
  3. Replies: 5
    Last Post: 08-07-2012, 11:14 AM
  4. Replies: 5
    Last Post: 06-28-2011, 06:40 PM
  5. Replies: 2
    Last Post: 06-01-2011, 09:32 AM

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