I am creating a userform at the bottom of which there are various commands including "Save".
When you click on this I ahve written in a series of checks to make sure that all the fields are filled in correctly but after that I want an "Are you sure you want to save" box with the options Yes and Cancel. (Cancel could be No if it makes it easier).
So far I have written:
' Message to check first
Dim confirm As VbMsgBoxResult
confirm = MsgBox("Are you sure you want to submit?", _
vbYesNo, "WARNING: Submit Data")
If confirm = 6 Then
' Write data to worksheet
RowCount = Worksheets("Database").Range("A2").CurrentRegion.Rows.Count
.Offset(RowCount, 0).Value = Me.txtPN.Value
.Offset(RowCount, 1).Value = Me.txtCd.Value
.Offset(RowCount, 2).Value = Me.txtDoj.Value etc... (there's a lot!)
' replace text content
Then there's a bit more at the bottom so after you've saved the form clears.
the bit I'm stuck with is the Else... i.e what do i write to make that message box disappear and return to the form as it is? I have a cancel command already on the form but it's code is just:
Private Sub cmdCancel_Click()
I have the deadline fo tomorrow for my boss! Help!!!
April 7, 2009 7:10 PM
April 16, 2009 9:55 AM