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:
Private Sub Form_Load() If lngMyEmpID = 0 Then DoCmd.ApplyFilter , "Squadron IN('MXS','AMXS','MOF')" ElseIf lngMyEmpID = 1 Then DoCmd.ApplyFilter , Squadron = "RQW_HQ" ElseIf lngMyEmpID = 2 Then DoCmd.ApplyFilter , "Squadron IN('101','102','103','OG_HQ','OSF')" ElseIf lngMyEmpID = 3 Then DoCmd.ApplyFilter , "Squadron IN('MSG_HQ','MSF','SFS','SVF','LRS','CES','CF','MDG')" End If End Sub




Reply With Quote