Dim RS As DAO.Recordset Set RS = CurrentDb.OpenRecordset("tblAuthorizationFormData") If DCount("*", "tblAuthorizationFormData", "PetID = " & Me.txtPetID) > 0 Then MsgBox "This request for pickup already exists and will be edited if you have made changes." RS.Edit RS!PetID = Me.txtPetID Etc., etc. RS.Update Else MsgBox "This appears to be a new pickup request which does not already exist in the program. A new pickup request is being created." RS.AddNew RS!ReqForPickUpID = Me.txtReqForPickUpID RS!PetName = Me.txtPetName Etc., etc. RS.Update MsgBox "The new pickup request has been created in the Authorization Form Data table." End If
From novice to tech pro — start learning today.