troubleshooting Question

error running code

Avatar of jeannie Jones
jeannie JonesFlag for United States of America asked on
Microsoft Access
4 Comments1 Solution16 ViewsLast Modified:
Private Sub cmdMove_Click()
'DoCmd.Save
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim rec2 As DAO.Recordset
Dim ProjNorec As Integer
Set db = CurrentDb
Set rec = db.OpenRecordset("PLC_PCR_Temp", dbOpenDynaset, dbSeeChanges)
Set rec2 = db.OpenRecordset("TrackerProjectNo", dbOpenDynaset, dbSeeChanges)
  If IsNull(Me.TEstimateCompleteDate) Then
         If Me.TProjectApproved <> "Yes" Then
            MsgBox " Please enter the due date and Yes option in approved field before approving...", vbOKOnly, "New Project to be approved"
            Me.TEstimateCompleteDate.SetFocus
         Else
            MsgBox " Please enter the due date before approving...", vbOKOnly, "New Project to be approved"
            Me.TEstimateCompleteDate.SetFocus
         End If
    Else
        If Me.TProjectApproved = "Yes" Then
        rec2.MoveLast
       recid = rec2("ProjectID")
       recid = recid + 1
        rec2.AddNew
        rec2("ProjectNo") = ""
        rec2("DateSubmitted") = Me.TSubmittedDate
        rec2("DateEntered") = ""
        rec2("TechAssigned") = Me.TAssignedTechnician
        rec2("Requestor") = Me.TRequestor_Name
        rec2("Department") = Me.TDepartment
        rec2("Manager") = Me.TDepartmentManager
        rec2("ContactNo") = Me.TContactPhoneNo
        rec2("AreaAffected") = Me.TAreaAffected
        rec2("ProjectOverview") = Me.TProjectApproved
        rec2("Notes") = Me.TTechnicianNotes
        rec2("DueDate") = Me.TEstimateCompleteDate
        rec2("CompletedDate") = Me.TCompletedDate_Time
        rec2("TestDate") = Me.TTestDate
        rec2("ProdDate") = Me.TCompletedDate_Time
        rec2("ProjectApproved") = Me.TProjectApproved
        rec2("ProjectStatus") = Me.TCapaStatus
       
        If Not (fDelCurrentRec(Me)) Then
           MsgBox " New Project Request has been Approve...", vbOKOnly, "New Project"
           Me.TempCapaNo.SetFocus
           TAssignedTechnician.Enabled = False
           TSubmittedDate.Enabled = False
           TRequestor_Name.Enabled = False
           TDepartment.Enabled = False
           TAFENo.Enabled = False
           TAFE_Hours.Enabled = False
           TProjectApproved.Enabled = False
           TAreaAffected.Enabled = False
           TProjectSummary.Enabled = False
           TCAPANo.Enabled = False
           TDepartmentManager.Enabled = False
           TContactPhoneNo.Enabled = False
           TReqCompletedDate.Enabled = False
           TEstimateCompleteDate.Enabled = False
           TCapaStatus.Enabled = False
           TProjectDetails.Enabled = True
           TTechnicianNotes.Enabled = False
      End If
   Else
     
     
     MsgBox " This project has not been approved. Please Choose YES...", vbOKOnly, "Approved Project"
     
     Me.TempCapaNo.SetFocus
     Me.Requery
     Me.Refresh
  End If
End If

End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros