Results 1 to 7 of 7
  1. #1
    frankq is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    5

    Calculated date does not show in table

    Hi I have been looking all over the net for a solution to this problem I hope someone can help me.I am a complete novice at using Access and have learned most of what little I know by trial and error and from the net.

    I have created a database of electrical equipment that has to be tested every 12 months.
    I created a form using the wizard that contains all the fields that need entering, including 'date tested' and date of 'next test'. To get the form to automaticaly fill in the date of next test field which is always 12 months from the Date tested field, I used this formula? =DateAdd("yyyy",1,[Pat Test Database 2011.Date tested])in the 'Date of next test' box in the forms design view.
    I also created a couple of queries, one that checks for if the item has been scrapped (it looks for the word Scrapped in the 'Comments' field and one that checks if the 'Date of next test' is overdue, using Date() or<Date() as the query in the 'Date of next test' field.

    I started to populate the Database from the paper records using the form, after I had entered a few I ran the overdue date query this came up with far fewer records than it should from records entered.
    When I checked the table I could see that the 'Date of next test' wasn't filled in on most of the records, so that when I run the query it can not work on those records.

    If I go back to the Form and use the arrows to scroll through all records I have the calculated date in the 'Date of next test' box. I have searched for answers on this and found nothing I understood. Please bear in mind as a complete novice at this, SQL and VBA are a complete mystery to me.
    I would be grateful if anyone can advise me on what I need to do to solve this problem

    Frank
    p.s. I forgot to say that whilst a few entries were ok at the start now all 'Date of next test' entries on the form do not update the table I am having to go into the table and enter them manually which defeats the object somewhat
    Last edited by frankq; 06-21-2011 at 04:04 AM. Reason: incomplete post

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You need to set the date of 'next test' in the AfterUpdate event of the 'date tested' control.

  3. #3
    frankq is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    You need to set the date of 'next test' in the AfterUpdate event of the 'date tested' control.
    Thanks for the reply, I am not sure what it means though.
    I have opened the form in design view and opened properties for the 'Date tested' text box. In the event tab the AfterUpdate line has [Event Procedure] entered in it (exactly as typed with brackets) . Is this the entry I need to change? and if so what do I put in there please?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    On the AfterUpdate row of the property sheet for the control just press the "..." button and select code if it asks. Then after the Private Sub line put:
    Me.NextTestControlName = DateAdd("yyyy",1,Me.DateTestedControlName)
    ...using your control names of course.

  5. #5
    frankq is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    On the AfterUpdate row of the property sheet for the control just press the "..." button and select code if it asks. Then after the Private Sub line put:
    Me.NextTestControlName = DateAdd("yyyy",1,Me.DateTestedControlName)
    ...using your control names of course.
    Brilliant! it took me a while to realise I had to put underscores in the control names but I now have
    Me.Date_of_next_test=DateAdd("yyyy",1,Me.Date_test ed) entered and it seems to be working just fine. Having entered a few new records I checked the table and could see the Date of next test entries are being added and the query to check overdue dates seems to be working fine.
    Thank you so much for being patient with what must be a simple thing for a regular user

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That is one of the reasons I use CamelFontNames! Are you ready to use the Thread Tools and mark this thread as Solved?

  7. #7
    frankq is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    5
    I have done that Thanks again

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

Similar Threads

  1. Default Calculated Date Value
    By HMEpartsmanager in forum Forms
    Replies: 17
    Last Post: 09-12-2012, 08:37 AM
  2. Replies: 5
    Last Post: 06-13-2011, 01:30 PM
  3. Criteria to show date range
    By Douglasrac in forum Queries
    Replies: 2
    Last Post: 03-24-2011, 03:58 PM
  4. query to show gaps in a date field
    By Lockrin in forum Database Design
    Replies: 1
    Last Post: 05-28-2010, 10:48 AM
  5. Setting criteria in a calculated date field
    By SteveReberger in forum Access
    Replies: 0
    Last Post: 10-29-2008, 06:58 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