Solved Filter Combobox based on textbox valeu (1 Viewer)

mafhobb

Registered User.
Local time
Today, 02:13
Joined
Feb 28, 2006
Messages
1,245
Hi.

This is probably really simple but I am struggling.

I have a combobox on a form that has the following RowSource:

SELECT [qryCleaningCostPerProperty].[PropertyName], [qryCleaningCostPerProperty].[CleaningType], [qryCleaningCostPerProperty].[CleaningCost] FROM [qryCleaningCostPerProperty];

This combobox shows all the data for all the properties ("PropertyName" field)

In this same form, I have a textbox (txtPropertyName) which is filtered on load to a specific property.

How do I filter the combobox so it only shows the records for that property?

mafhobb
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:13
Joined
May 7, 2009
Messages
19,232
maybe add code to the Current event of the form:

private sub Form_Current()
With me!combo
.RowSource = "SELECT [qryCleaningCostPerProperty].[PropertyName], [qryCleaningCostPerProperty].[CleaningType], [qryCleaningCostPerProperty].[CleaningCost] FROM [qryCleaningCostPerProperty] Where [PropertyName] = '" & Me![txtPropertyName] & '
 

mafhobb

Registered User.
Local time
Today, 02:13
Joined
Feb 28, 2006
Messages
1,245
Got it.
Many thanks!
Mafhobb
 

Users who are viewing this thread

Top Bottom