Results 1 to 4 of 4
  1. #1
    islewis is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    4

    Data Entry based on dates

    Hello,



    I have a form that enters a transaction into my database. The user will input two dates: the start date and the end date. The transaction takes place each month. So for example: If the start date is 07/01/2014 and the end date is 12/31/2014 then I need 6 record entries. I am basically trying to decompose a calendar spread into separate transactions. It should be something like If startdate = #07/01/2014 Then If enddate = #12/31/2014# Then some sort of DoCmd to enter multiple records based on the user input data detailing the transaction. Maybe I need to set up a recordset? I am lost. Any help is appreciated. Thanks

  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    You should use the DateDiff code like this :

    Datediff("m",FirstDate,SecondDate)

    Make three fields on your form, One startdate, one End date. Then the third holds the difference in dates (number of months).
    You can make this field visible or not..

    Then you make a command that makes new records at the amount of the third field.

  3. #3
    islewis is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    4
    I will give that a shot. How will that aid me in entering multiple records? Also, where would I add the datediff code? Or which property would this go in?

  4. #4
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    I will try to make an example when im at work tomorrow, ok ?

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

Similar Threads

  1. Limit data entry based on another field
    By chemengr in forum Forms
    Replies: 5
    Last Post: 01-02-2014, 01:21 PM
  2. Replies: 0
    Last Post: 02-17-2013, 11:17 PM
  3. Limiting entry in date field to three dates
    By cmwpcol in forum Access
    Replies: 5
    Last Post: 09-24-2012, 03:49 PM
  4. Importing data based on dates
    By sentil in forum Programming
    Replies: 1
    Last Post: 07-09-2011, 01:56 AM
  5. Replies: 0
    Last Post: 07-27-2009, 07:51 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