Private Sub MDIForm_Load() f1.Show f2.Show MsgBox Screen.ActiveForm.Name End SubSo at startup you see two forms, with F2 being the Active one.
Private Sub Form_Activate() f2.SetFocus f1.Enabled = False End SubAnd on form F2 I have a button with this code:
Private Sub Command1_Click() MsgBox Screen.ActiveForm.Name f1.Enabled = True f1.SetFocus End SubNow, when the program starts up and I click F1 (which was in the background because F2 is my active form), F2 is made Active and F1 is disabled. Makes sense. However, when I know press the command button on F2, the messagebox displays F1. That is interesting. This appears to be a bug, which is documented at Microsoft at: