You can limit which records of a dataset are present as features in a theme
by applying a Theme Definition Query. This article demonstrates how to apply a theme definition for the ESRI sample data counties.shp so that only Ohio counties are present. For more information refer to the ArcView Help topic "Defining a feature selection for a theme."
'-- Creating a new theme from a feature source:
theView = av.GetActiveDoc
'-- Replace the path to match your feature data source
theTheme = Theme.Make("c:\esri\esridata\usa\counties.shp".AsSrcName)
theFTab = theTheme.GetFTab
'-- Example of using a string field for query
SearchStr = MsgBox.Input("Enter the Search String:",
"Input Window", "Ohio")
theQuery = "[State_Name] = " + SearchStr.Quote
'-- Example of using a numeric field for query
'theFTab.SetDefinition("[Fips] = 2336")
The path to the counties shapefile referenced in the second line of code may differ from the path on your machine. Edit this path to match the sample data directory on your machine or to point to another data set.