Hey people, How do I keep the VbForm open? Here's the goal. Form open > Is the data complete? Yes = Save If No, keep the form open to complete the details.
Private Sub QuestionForm_Save_Button_Click()
Dim answer As Integer
answer = MsgBox("Is the data complete? This is irreversible.", vbQuestion + vbYesNo + vbDefaultButton2)
If answer = vbYes Then
Sheets("Question Form Data").Select
Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("QuestionTable[[#Headers],['#]]").Select
ActiveCell = GuideName_Textbox
ActiveCell.Offset(0, 1) = ProductType_ListBox
ActiveCell.Offset(0, 2) = Questiondetails_TextBox
ActiveCell.Offset(1, 0).Select
Sheets("Menu").Select
MsgBox "Data has been saved"
Unload Question_Form
Else
MsgBox "Make sure to complete the form"
'Question_Form.I DONT KNOW WHAT TO DO TO KEEP IT OPEN
End
End If
End Sub
_________________
Private Sub QuestionForm_Cancel_Button_Click()
Unload Question_Form
End Sub
Private Sub QuestionForm_Save_Button_Click()
Dim answer As Integer
answer = MsgBox("Is the data complete? This is irreversible.", vbQuestion + vbYesNo + vbDefaultButton2)
If answer = vbYes Then
Sheets("Question Form Data").Select
Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("QuestionTable[[#Headers],['#]]").Select
ActiveCell = GuideName_Textbox
ActiveCell.Offset(0, 1) = ProductType_ListBox
ActiveCell.Offset(0, 2) = Questiondetails_TextBox
ActiveCell.Offset(1, 0).Select
Sheets("Menu").Select
MsgBox "Data has been saved"
Unload Question_Form
Else
MsgBox "Make sure to complete the form"
'Question_Form.I DONT KNOW WHAT TO DO TO KEEP IT OPEN
End
End If
End Sub
_________________
Private Sub QuestionForm_Cancel_Button_Click()
Unload Question_Form
End Sub