Results 1 to 3 of 3
  1. #1
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129

    Populate controls in next record Continuous Form

    I have a continuous form with the controls
    MStartDate (first day of month)
    MEndDate (last day of month)
    RAV_Meter (number)
    This is used to record the meter reading and is used elsewhere to compare performance against other data on a monthly basis
    what I thought would be really helpful to save time and errors would be if on moving to the next record if the MEndDate is entered, the new record MStartDate would be populated with the next day (1st day of month) with the RAV_Meter populated with the previous meter reading.
    If moving from the RAV_Meter and the MEndDate is blank the focus could be set to the MEndDate in the next record. I have been playing around for ages but with no joy. Maybe someone has done something like this? thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Customarily, only the current/ending meter reading and date would be recorded. Query would retrieve values from the previous record to use in calculation for the difference. Review http://allenbrowne.com/subquery-01.html#AnotherRecord

    Don't understand why RAV_Meter would be populated with previous meter reading. Where do you put the current/ending meter reading?
    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
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Never tried it before but... you could put some code in the MEndDate double click event. You could start with a vbYesNo to confirm adding a record and then execute something like


    dim endDate as date
    dim strMeter as string

    endDate = me.MEndDate
    strMeter = Me.RAV_Meter

    DoCmd.GoToRecord , , acNewRec

    MStartDate = endDate + 1
    Me.RAV_Meter = strMeter

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

Similar Threads

  1. Replies: 11
    Last Post: 01-25-2013, 12:03 PM
  2. Replies: 3
    Last Post: 10-12-2012, 01:38 PM
  3. Hiding a new record in a continuous form
    By system243trd in forum Forms
    Replies: 3
    Last Post: 12-03-2011, 01:04 AM
  4. Get position of record in continuous form
    By Whizbang in forum Forms
    Replies: 3
    Last Post: 11-02-2011, 01:47 PM
  5. Replies: 2
    Last Post: 05-22-2009, 01:07 PM

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