I have a Event Details dialog form to add new events. The form can be opened up from two different forms, the main Current Events list form and the Calendar view. I have the following code in the On Close event that syncs the Calendar with the new record.
Private Sub Form_Close()
'Explicitly Set Focus to the Calendar Form
Forms![frmCalendar].SetFocus
'Activate the Shortcut Key for the Sync Command Button
SendKeys "%S", True
End Sub
Everything works fine but if I open the Events dialog form from the Current Envents form and the calendar is closed, I get the nagging error message on close that it cannot find the form "frmCalendar". I tried setting warning to off but that doesn't work for these kind of error messages.
For now I have duplicated the dialog form and have each opening from the oppropriate form which is a simple fix. However, I have too many forms now and I would like to use just one. I also have a couple of forms that requery another form on close and I see the same error message on those if the target form is not open.
Thanks
Private Sub Form_Close()
'Explicitly Set Focus to the Calendar Form
Forms![frmCalendar].SetFocus
'Activate the Shortcut Key for the Sync Command Button
SendKeys "%S", True
End Sub
Everything works fine but if I open the Events dialog form from the Current Envents form and the calendar is closed, I get the nagging error message on close that it cannot find the form "frmCalendar". I tried setting warning to off but that doesn't work for these kind of error messages.
For now I have duplicated the dialog form and have each opening from the oppropriate form which is a simple fix. However, I have too many forms now and I would like to use just one. I also have a couple of forms that requery another form on close and I see the same error message on those if the target form is not open.
Thanks