Hi, I have a Function below, I am calling this in query and having error when form is not loaded or closed and i want that if form is not loaded then the query to show all records or in simple words should ignore this criteria without any pop up error message
Function IsFormLoaded(strForm As String) As Boolean
Dim frm As Form
For Each frm In Forms
If frm.Name = strForm Then
IsFormLoaded = True
Exit Function
End If
Next
End Function
Calling with if condition in query ;
IIf(IsFormLoaded('searchins'),[Forms]![SearchIns]![dr2],")
Function IsFormLoaded(strForm As String) As Boolean
Dim frm As Form
For Each frm In Forms
If frm.Name = strForm Then
IsFormLoaded = True
Exit Function
End If
Next
End Function
Calling with if condition in query ;
IIf(IsFormLoaded('searchins'),[Forms]![SearchIns]![dr2],")