Most likely, your lookup field has a combox bound to the ID field, not the field holding the values displayed.
When you click and open the filterbox, you can filter on the ID only, not the displayed value.
So, this is not possible. you must choose another concept.
I am pretty lost.
Maybe its best to look at my db.
I pared it down.
I want to be able to filter cbo for "sent to HB"
thank you....
Tony, that file contains a table and a report - no form, no combobox ...
HI Gustav, I accidentally attached the wrong db. So sorry about that. I posted it below.
OK.
As said, you can't do that. If you unhide the first column of the combobox, you can set the filter to, say, 2, and it will filter.
However, this method can only filter on the bound column, and this column must be visible.
PS: Hope you are doing well. Missing SA and the sand? I guess not.
Hi Gustav,
thanks for the response. I was looking to implement the Got Focus event with John's code. I am not sure if you are referring to this or not.
Yes, I am glad I am back in the USA. Saudi was not fun.
Mark
I am trying to follow John's code.
I am putting the below in teh row source of the cboStatus2
I am sure I am not following becuase I dont think I can refer to Me in the where condition like I am.
SELECT tblStatus.ID, tblStatus.Status
where cboFilterFavorites = " & Me.cboStatus2
FROM tblStatus ORDER BY tblStatus.Status
Gustav:
< If you unhide the first column of the combobox, you can set the filter to, say, 2, and it will filter.
Yes, I tried and I can sort but its not as useful to filter on the number instead of the text.
Hi John, I am implementing your code. If you have a chance to respond...
I was looking to implement the Got Focus event with John's code. I am not sure if you are referring to this or not.
I was not. I referred to your sample database.
Please note, that the various methods using traditional code will not work as they are not related to what you try to: to set the filter for a field.
So, as already mentioned, you will have to rethink your concept.
wow that is nice. It works in the uploaded db above. I am trying to copy the code over and when I click on the dropdown and select "Sent to HB" in my db I get a msg box prompt for UStatus? Could you kindly let me know what I am doing wrong?
the below is what I copied into my db and no other codes or cbo.
Private Sub cboFilterFavorites_AfterUpdate()
Me.Filter = "UStatus = '" & Me.cboFilterFavorites.Column(1) & "'"
Me.FilterOn = True
End Sub
Hi John, sorry for my late reply. I now see the extra field. I see that you also changed tblProjects.status from text to number property. I somehow opened up the wrong db. Nice craftiness indeed. Thanks again.
e.g your combobox has a controlSource :
Open in new window
if you want to filter itOpen in new window
orOpen in new window