Hi i have a database with a form that i have added a checkbox to (check325), what i want to do is have a msgbox appear if command 261 is clicked to say 'please complete check box'. here is the original code.
vb Code:
Private Sub Command261_Click() 'On Error GoTo Err_Command261_Click If IsNull(Me.Text266) Or Trim(Me.Text266) = "" Then MsgBox "Please provide Work Status", vbInformation, "Cworks" Me.Text266.SetFocus Exit Sub End If Dim rspmsched As DAO.Recordset Dim response If Me.WorkStatus.Column(0) = 2 Then If IsNull(Me.ActDateStart) Or IsNull(Me.ActDateEnd) Then MsgBox "Please provide an Actual Start Date and Actual End Date", vbOKOnly + vbExclamation Me.ActDateStart.SetFocus Else response = MsgBox("Closed work orders cannot be modified. Do you want to proceeed ?", vbYesNo + vbInformation + vbDefaultButton2, "Confirm Save") If response = vbYes Then If Me.WorkType = 2 And Me.WorkStatus = 2 Then Set rspmsched = CurrentDb.OpenRecordset("Select * from [PM Schedule] where [PM Schedule].PMNo='" & Replace(Me.PMNo, "'", "''") & "' and [PM Schedule].TypePMgen='2'") If rspmsched.EOF = False Then rspmsched.Edit rspmsched![ActualCompDate] = Format(Me.ActDateEnd, "Short Date") rspmsched![nextdate] = rspmsched![ActualCompDate] + (rspmsched![Frequency] * rspmsched![FreqUnits]) rspmsched.Update End If rspmsched.Close End If DoCmd.Close Else Exit Sub End If End If ElseIf Me.WorkStatus.Column(0) <> 2 Then DoCmd.Close End If End Sub




Reply With Quote