Results 1 to 4 of 4
  1. #1
    wnicole is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    118

    Entering records by using calendar

    I have a database where we do scheduling. I would like to be able to choose a duration of dates and it create records for each of those days.
    I don't mind going to each one and entering data...but having something that may ask if I like to duplicate data for each records (different days of course) would be great.


    Is this complicated?

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Pretty basic, actually.

    You'll use :
    A form, which allows the user to choose the starting and ending date.
    Some fields on that form for any information that is to be repeated.
    A button on that form that says "Create Records"

    Behind that button, in the Click Event, you'll have VBA code that does the following:
    1) validate the fields on the form, especially the beginning and ending dates.
    2) Exit with an error message if anything is critically missing or bad.
    3) Loop through from the first date to the last date, and for each date, add a record with the entered information.

    The loop could either be doing an INSERT to the table with DoCmd.RunSQL, or it could be doing a combination Recordset.ADDNEW and Recordset.UPDATE. There's sample code for either of those all over the internet.

  3. #3
    wnicole is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    118
    Can you tell me what the title of the code would be I can search the net?

  4. #4
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Here's a thread that has an example in it
    https://www.accessforums.net/queries...nge-36173.html

    The thread is not all relevant to your question. Just look at the code in post #6 in the routine called LoadMonthDates. For your requirements, you would NOT use the part that executes a DELETE against the same table.

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

Similar Threads

  1. Entering
    By sevanty7 in forum Forms
    Replies: 1
    Last Post: 05-14-2013, 01:06 PM
  2. Entering multiple records on one form.
    By thefairman in forum Forms
    Replies: 4
    Last Post: 02-28-2012, 01:22 PM
  3. Entering a name in query
    By jon01 in forum Queries
    Replies: 5
    Last Post: 12-20-2011, 08:55 AM
  4. entering new records
    By MissRyan in forum Access
    Replies: 6
    Last Post: 06-29-2011, 04:39 AM
  5. entering one value but storing another
    By greatfallz in forum Forms
    Replies: 1
    Last Post: 06-09-2011, 07:23 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