Thank you all for your helpful suggestions, they are awesome. I decided to go with the enabled method, which works great. I am hoping that someone can help me with one last thing. Its along the same lines but if we can't solve it I can start a new thread for it. So I turned enable to no for everything that I needed to. when I open my form, the Contract Number has focus, so I put the code in the lost focus event. But if I type a contract number, lose focus, then delete the contract number, when I close the form it saves the record with no contract number, which is obviously not what I want to do. so I put some code in the exit command button. Most of it works fine, but I cant seem to find where to put the End IF codes to make it all work perfectly. This is what I am trying to do, if the contract number is blank, ask if the user would like to enter a number or not. If no, then it deletes the record and closes the form, if yes, it takes the user to the contract number. it all works fine, but if there is a contract number, the form doesn't close, it doesn't do anything.
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
If IsNull(Me.[NYSDOT_Contract_No]) Then
If MsgBox("Contract Number has to be Entered. Press Yes to Enter a Contract Number or No to Delete This Record", vbQuestion + vbYesNo) = vbYes Then
Cancel = True
Me.NYSDOT_Contract_No.SetFocus
End If
Else
If Me.Dirty Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Close
End If
If Me.Dirty Then Me.Dirty = False
DoCmd.Close
Exit_cmdExit_Click:
Exit Sub
Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click
End If
End Sub