Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010

    Unanswered: If a date it null in a form cannot go to next record

    Hello all, I am having difficulties and am hoping that someone might know how to fix this. (I am very new to VBA)
    So, what I have is a form (In edit mode) that has the following values:
    Start Date - Preassigned
    Due Date - Preassigned
    Completed Date (they need to enter)
    Task Complete (Check box they need to enter)
    Date Entered (auto fill with code if me.Task_Complete = -1 Then me.Date_Entered = now() )

    Anyway, what I am attempting to do is if the task complete box is checked, then they must have a date entered in the completed date. (Since these managers might do the assigned task and then wait a week to mark it complete)

    Here is the code that I currently have:
    Private Sub Task_Completed_Click()
    If Me.Task_Completed = -1 Then
    Me.Date_Entered = Now()
    Me.Date_Completed = ""
    MsgBox "Please enter the date you completed the task", vbinfomration, "Date Needed"

    End If

    End Sub

    I thought this would work, but unfortunately it doesn't.

    Could someone please tell me what I am doing wrong?


  2. #2
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    I would use the before update event of the form:

    Before update

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts