Results 1 to 14 of 14
  1. #1
    asoe209 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    42

    forms not populating data in date field in table

    Hello, just a quick one od some thing I have come across today.

    I have a form, and on this form I have 3 date fields that i enter a date that something was tested, the other 2 date fildes I have put calculations in to calculate 12 months on the the test date and a cound down of how many days are left.

    e.g.

    Date one. 01/01/2013
    date two 09/04/13 calculated to 98 days from date one wit the following =DateAdd("d",98,[LastPMI])


    date 3 just counts down, so no real concern with this one, but date 2 is the one tat i need. as its the due date.

    I have just notice that the date that calculates the future date does not put a date in my table that the form is linked to. so I now im getting wrong date data.

    Is there some thing that can be done to corect this or will I just have to enter that dates manually.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Maybe you will find this link helpful: http://allenbrowne.com/casu-14.html

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    You would not usually save the "due date" to a table because it is a calculation. The calculation should be done where ever and when ever it is needed using the expression: =DateAdd("d",98,[LastPMI])
    See:
    http://allenbrowne.com/casu-14.html
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    asoe209 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    42
    but the date that is generats is not saved to the table so it does not run the correct date in queries and reports

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by asoe209 View Post
    but the date that is generats is not saved to the table so it does not run the correct date in queries and reports
    So use the calculation in those queries and reports.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Did you review the link both Bob and I supplied?

  7. #7
    asoe209 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    42
    Hi, yes I have read the link and I dont quite get how this will fix the problem on m form. as I still need the due date to be calsulated/workout for me

    i just do get why when it populates the date on my form at present but des not add tha to the table.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    As Bob said, you do not need the calculated dates in the table in order to calculate them in a query. How about trying to show us how you are attempting to use the calculated dates and we can then show you how to do the calculations right there.

  9. #9
    asoe209 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    42
    ok ill et some screen shots up after lunch.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    If you are using a table as the RecordSource of a Report or Form then changing that to a query and posting the SQL view of it will be all it takes. No pictures needed.

  11. #11
    asoe209 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    42
    hi, Ihave gone ahead and done screen prints any way.

    as you can see, I put the date in the form, and the next dates are worked out. o table view you can see the date I entered but the following dates still blank even through shown on form.

    the query uses the the due date as to what is due for a month, but if nothing is in the field this will not happen. I then run my report base on the query.
    Attached Thumbnails Attached Thumbnails image1.jpg   image2.jpg   image3.jpg   image4.jpg   image5.jpg  


  12. #12
    asoe209 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    42
    to foollow on, please remember I am a oob at this so some tings said do go over the head....
    Attached Thumbnails Attached Thumbnails image6.jpg  

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Is the "NewLiftingTestDue" query the RecordSource of the PlantManagementForm?

  14. #14
    kwolfel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Posts
    15
    Under the Property Sheet > Data tab, do you have the Record Source filled in with the field from your table that you expect the calculated dates to fill? It sounds like the Record Source may contain the actual calculation. If this is true, I would recommend moving the calculation to an "After Update" event in Property Sheet > Event tab of the first date field (that you enter). From here, you can use visual basic code to assign the other two date fields to equal the calculations you want.

    Example code:

    Private Sub [Name of Date Combo/Textbox]_AfterUpdate()

    Me![Name of Date2 Combo/Textbox] =DateAdd("d",98,[LastPMI])
    Me![name of Date2 Combo/Textbox] = calculation

    End Sub

    This setup would allow you to enter a date into the first field and the "AfterUpdate" would automatically populate the other two field textboxes based on the calculations. By setting the Record Source of the other two date fields to the appropriate fields in the table, the calculated dates should get saved into the table.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-21-2012, 06:19 PM
  2. Populating table with data from the Web
    By ser01 in forum Programming
    Replies: 8
    Last Post: 06-15-2012, 08:27 AM
  3. Replies: 2
    Last Post: 09-28-2011, 02:41 AM
  4. Replies: 17
    Last Post: 03-29-2010, 10:55 AM
  5. Populating Data in forms
    By cjbeck71081 in forum Forms
    Replies: 4
    Last Post: 01-16-2007, 04:15 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