Link to home
Start Free TrialLog in
Avatar of Shadi Saleh
Shadi Saleh

asked on

MS Access: ComboBox is populated via VBA but items won't show

I have a form that contains a subform.

In the form I have a search box and a search by combobox.

The search by combo box should be populated with the searchable fields on the subform.

I write a simple vba code that I can see it does its job, but the the problem is that the combobox is still empty.

A showcase tiny database is attached.
ShowCase-.accdb
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Adjust your filter to include what you search for:

strFilter = Me.Search_By_combo.Value & " Like '*" & Me.Search_For_Box.Text & "*'"

Open in new window

/gustav
Avatar of Shadi Saleh
Shadi Saleh

ASKER

@Gustav Brock: Thanks for this  important -yet aside-  note.

Hope you can help with finding out why the combobox won't show items after being populated. The only value that could appear is First Name because I chose it as a Default value from the design view mode.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What a behaviour of Access!

Thanks a lot Gustav. The was really helpful, really pro and really expert.
Thank you. You are welcome!

/gustav