Hi,
Apologies if I'm missing something really easy here:
I have a TabStrip with 4 tabs on my form. When the user is editing the information on one of the tabs I want to display a message box confirming whether the data should be saved. Here is what I have:
Private Sub tabMainForm_Click(PreviousTab As Integer)
If editing Then
If MsgBox("Save changes?", vbYesNoCancel, applicationTitle) = vbYes Then
cmdSave_Click (tabMainForm.Tab)
End If
End If
If tabMainForm.Tab = 1 Then
staffRst.Fields("BI") = CalculateBI
staffRst.Update
txtBI.Text = staffRst.Fields("BI")
End If
End Sub
The program will switch to the new tab before displaying the message. Is there any way I can show the message box first then decide whether to switch tabs?
Thanks in advance,
Andy.