Remove Limit to list when in filter

E

Emma Aumack

Hi all,

I have a main data entry form, Frm_Tbl_Master_Jobs, on which there is a
combo box, cbo_RepName, that contains names of sales reps. I have set the
Limit to List property on cbo_RepName to yes; however, when filtering I need
this to remove the Limit to List restriction because even though a rep no
longer is available for a new record they have been entered on previous
records and therefore I should be able to filter on that name even though it
is not available. I want the Limit to list to remain in place for new
records. How do I remove the Limit to List restriction on the filter only.

Thanks for your help!
 
R

roger

I shouldn't do your work for you:

Private Sub Form_Filter(Cancel As Integer, FilterType As Integer)
If Me.FilterOn = True Then
Me.Combo8.LimitToList = False
Else
Me.Combo8.LimitToList = true
end if
End Sub

I haven't tested that, and you'll need a eventproc in the form's filter event
 
E

Emma Aumack

Your are absolutely right. I should have spent a little more time on it
before I posted. After I posted I realized that I could use the LimitToList
property. Thank you for you response anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top