I have a Cancel button on a form. This event is designed so that there is a query to ask the user if they want to save any changes made to the content of the record (see the lower code block). I have eliminated this query and changed the event to just go ahead and save any changed in the record content. This is done using the first code block below, as opposed to the original process.
It works fine, but I have a combobox and I want to be able to include any changes made to the text property of that control. cboOwner.modified won't work, as I suspected. How can I check cboOwner for a change in cboOwner.Text?
I am sure that there are probably numerous ways to achieve this, and I would be happy to consider them, but this was the only thing that came to mind that worked for me with the textbox controls.
Original methodCode:If txtTask.Modified Or txtStart.Modified Or txtEnd.Modified Or txtComplete.Modified Or txtNotes.Modified Then btnSave.PerformClick() Else Me.Close() taskList.btnRefresh.PerformClick() taskList.Show() End If
Code:If SaveTask <> True Then If MessageBox.Show(SaveMessage, "Cancel Task Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = MsgBoxResult.Yes Then btnSave.PerformClick() SaveTask = True End If End If Me.Close() taskList.btnRefresh.PerformClick() taskList.Show()




Reply With Quote
