Hello, all help is greatly appreciated.
I a few main forms and on each main form I have a button that pops up a new member form. When I close out of the new member pop up form I need it to refresh which ever main form had spawned it.
At first I tried doing it on the Private Sub Form_Close() but it kept getting errors. I did some research and found that it can be done in a function which I’m showing below but get the error when calling the function.
Here’s the code I’ve been trying but I’m getting a “byref argument type mismatch” error on the bolded "ADL_Main" below in the sub proc.
Private Sub Form_Close()
If CurrentProject.AllForms(ADL_Main).IsLoaded = True Then
Call IsOpenForm(ADL_Main)
End If
If CurrentProject.AllForms(BES_Main).IsLoaded = True Then
Call IsOpenForm(BES_Main)
End If
End Sub
Public Function IsOpenForm(frmName As String) As Boolean
If CurrentProject.AllForms(ADL_Main).IsLoaded = True Then
IsOpenForm = True
MsgBox "ADL_Main is open"
'Forms![ADL_Main].Refresh
End If
If CurrentProject.AllForms(BES_Main).IsLoaded = True Then
IsOpenForm = True
MsgBox "BES_Main is open"
'Forms![BES_Main].Refresh
End If
End Function
Thanks!