Results 1 to 3 of 3
  1. #1
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67

    URGENT - Code stopped working

    I don't know what happened with this - I have tried compacting and repairing and it's not helping, at this point I don't know what to do!

    This is my code for the on load event of a form





    Private Sub Form_Load()
    If ([Bank Modified Date]) <= Date - 10 Then
    DoCmd.OpenForm "frmOlderThanFourteen", acFormDS
    DoCmd.Close acForm, "frmActivators"
    End If
    End Sub

    The form is a datasheet form with the following fields;

    Paymode ID, Company Name, Date of Enrollment, Status, Date Modified, Number of Contacts, Issue, Paymode X Product, Assigned, Bank Mismatch, Comments, Bank Modified Date

    The Bank Modified Date is a hidden column

    This code was working this morning and is no more....can someone help PLEASE?!

    I'm not getting any error it's just acting like there are no records in that date range (there are PLENTY)

  2. #2
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67
    P.S. the same code on another computer's local copy is working - I even tried importing the working form back into the DB and that didn't help

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Your if statement is acting on the first member of the form's recordset, and only the first, so if the condition is false, then nothing appears to happen. The reason your code "no longer works" is that the data has changed.

    I doubt that is what you want to do - I will hazard a guess that what you really want to do is open the "frmOlderThanFourteen" form to display ALL the records that qualify. Is that correct?

    John

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

Similar Threads

  1. Access has stopped working
    By mrkaye in forum Access
    Replies: 0
    Last Post: 05-22-2012, 04:09 PM
  2. Microsoft access has stopped working
    By jhargram in forum Access
    Replies: 5
    Last Post: 03-28-2012, 04:46 AM
  3. Access has stopped working
    By phillb in forum Forms
    Replies: 9
    Last Post: 01-10-2012, 12:22 PM
  4. Open Report Filter Stopped Working
    By ggs in forum Reports
    Replies: 5
    Last Post: 09-27-2011, 05:05 AM
  5. All Buttons Stopped Working and...
    By rhoridge in forum Programming
    Replies: 1
    Last Post: 12-02-2010, 11:25 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