Avatar of jeannie Jones
jeannie Jones
Flag for United States of America asked on

error running code

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
Microsoft Access

Avatar of undefined
Last Comment
ste5an

8/22/2022 - Mon
Norie

What's the error and where in the code does it occur?
jeannie Jones

ASKER
it not doing what i need it to do i need it to take a project once a supervisor hits approve button and move the record to the Tracker Project No table now it doesnt do anything but delete the record
PLC_PCR1.zip
ASKER CERTIFIED SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck