I want this code to be written for a subform and I don't know how to rewrite it... I've tried Me.form1.form.filter = but that doesn't work. The forms name is form1 and I have no idea how to get the filter to work on it. Thanks!

VB Code:
  1. Private Sub Form_Load()
  2. If lngMyEmpID = 0 Then
  3. DoCmd.ApplyFilter , "Squadron IN('MXS','AMXS','MOF')"
  4.  
  5. ElseIf lngMyEmpID = 1 Then
  6. DoCmd.ApplyFilter , Squadron = "RQW_HQ"
  7.  
  8. ElseIf lngMyEmpID = 2 Then
  9. DoCmd.ApplyFilter , "Squadron IN('101','102','103','OG_HQ','OSF')"
  10.  
  11. ElseIf lngMyEmpID = 3 Then
  12. DoCmd.ApplyFilter , "Squadron IN('MSG_HQ','MSF','SFS','SVF','LRS','CES','CF','MDG')"
  13. End If
  14. End Sub