Hi Team, Good evening.
I have a bounded form with about 34 fields and I have a "Save" button (to just save the details to the master table) and a "Home" button (to go back home without saving the record when there are any changes made after it is saved). But some users are messing it up by just adding few fields and if they don't want to add a record, they simply click on the "Home" Button, but the form adds that data too. I have written the below code which is not helping me, can you please help me out?
I have a bounded form with about 34 fields and I have a "Save" button (to just save the details to the master table) and a "Home" button (to go back home without saving the record when there are any changes made after it is saved). But some users are messing it up by just adding few fields and if they don't want to add a record, they simply click on the "Home" Button, but the form adds that data too. I have written the below code which is not helping me, can you please help me out?
Code:
Private Sub Command325_Click()
'Home Button
If Me.Dirty And Me.Project_Name = "" Then
Me.Undo
'DoCmd.RunCommand acCmdUndo
Else:
Me.Dirty = False
'Me.lbl_LastSaved.Caption = "Saved: " & Date & " " & Time
End If
DoCmd.Close acForm, Me.Name, acSaveNo
Call MaximizeForm
End Sub