Public Sub EnergizeEquipment(ID As String)
If MsgBox("Are you sure you want energize?", vbYesNo, "Energize") = vbYes Then
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT * FROM [Main-Master] WHERE ([IDTag]='" & ID & "') OR ([Parent Equipment] ='" & ID & "')")
CurrentDb.Execute "UPDATE [Main-Master] SET [ActualEnergizationDate]='" & Format(Date, "mm/dd/yyyy") & "' WHERE [IDTag]='" & rst(IDTag) & "'"
Else
Exit Sub
End If
End Sub
|