You can't refer to a sub/function like that. Functions usually return a value, so it has to go on the right of equation:
SomeVariable = returnGUI ("fmProducts")
Try (as a function)
Code:
Private Sub Main_Menu_Click()
Dim Bln as Boolean
'passing the form name (fmProducts) when the button is clicked to Module1 function
bln = returnGUI ("fmProducts")
End Sub
Public Function returnToMain(theFormName As String)
Forms!fmInventory.Visible = True
DoCmd.Close acForm, theFormName
returnToMain = True
End Function
You can call a subroutine.
Code:
Private Sub Main_Menu_Click()
'passing the form name (fmProducts) when the button is clicked to Module1 function
Call returnGUI ("fmProducts")
End Sub
Public Sub returnToMain(theFormName As String)
Forms!fmInventory.Visible = True
DoCmd.Close acForm, theFormName
End Sub