Try this:

Give frmMain a special tag (like 25360) and use:

VB Code:
  1. Private Sub cmdBack_Click()
  2.     frmMain.Show
  3.    
  4.     Dim frm As Form
  5.    
  6.     For Each frm In Forms
  7.         If frm.tag <> 25360 Then
  8.             Unload frm
  9.             Set frm = Nothing
  10.         End If
  11.     Next frm
  12. End Sub