Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Posts
    21

    Unanswered: Help with code. I get Error 424 object required.

    Hi all,

    I'm still learning VBA and I need some help here. I got "object required error 424" when I run this. Basically I have a jobs form which contains the status of the each job. I am trying to automate this based on job start and end dates plus a cancel checkbox (chkcancel). Thanks for your help.



    If Nz(Me.txtstartdate.Value) < Now() And Nz(Me.txtEnd.Value) < Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) Is Null Then
    Me.cmbstatus.Value = "Setup"
    ElseIf Nz(Me.txtstartdate.Value) >= Now() And Nz(Me.txtEnd.Value) < Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) Is Null Then
    Me.cmbstatus.Value = "Active"
    ElseIf Nz(Me.txtstartdate.Value) >= Now() And Nz(Me.txtEnd.Value) > Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) Is Null Then
    Me.cmbstatus.Value = "Completed"
    ElseIf Nz(Me.txtstartdate.Value) >= Now() And Nz(Me.txtEnd.Value) > Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) > Now() Then
    Me.cmbstatus.Value = "Stips"
    ElseIf Nz(Me.txtstartdate.Value) >= Now() And Nz(Me.txtEnd.Value) > Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) < Now() Then
    Me.cmbstatus.Value = "Tied Out"
    ElseIf Me.chkcancel.Value > 0 Then
    Me.cmbstatus.Value = "Cancelled"
    Else
    End If

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    And this error highlights on what line of code????
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Apr 2002
    Posts
    21
    The first line is highlighted but each line of code contains a date or value (meaning Me.txtstartdate.Value = "6/24/04", Me.txtEnd.Value = "6/28/04" etc., Me.chkcancel.Value = 0, Me.txtdate.Value is null )

    If Nz(Me.txtstartdate.Value) < Now() And Nz(Me.txtEnd.Value) < Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) Is Null Then
    Me.cmbstatus.Value = "Setup"

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Sean72
    The first line is highlighted but each line of code contains a date or value (meaning Me.txtstartdate.Value = "6/24/04", Me.txtEnd.Value = "6/28/04" etc., Me.chkcancel.Value = 0, Me.txtdate.Value is null )

    If Nz(Me.txtstartdate.Value) < Now() And Nz(Me.txtEnd.Value) < Now() And Me.chkcancel.Value = 0 And Nz(Me.txtdate.Value) Is Null Then
    Me.cmbstatus.Value = "Setup"
    Then it sounds like you have a control name error ... Check that each control name used in your conditionals exists.
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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