I found the solution in the help files for the SQCSymbol and the BatchGroup.
I have had a few customers who wanted to make the SQC Chart specific to a discrete value, such as a maximum temperature for each batch, for a specific product. This simple link will bring them a lot of value.
Dim SQCobj As SQCSymbol
Dim sqcDef As SQCSymbolDefinition
Dim strEquation As String
Private Sub Display_Open()
Private Sub ComboBox1_Change()
Dim myTrendDef As BatchTrendDef
Dim myQuery As PIBatchView
Set SQCobj = ThisDisplay.SQCSymbol1
Set sqcDef = SQCobj.GetDefinition
strEquation = sqcDef.FilterEquation
sqcDef.FilterEquation = " 'PP:Digest1.Prod' =""" & ComboBox1.Value & """"
' Get the query definition from the BatchGroup
Set myTrendDef = BatchGroup1.Trends(1).GetDefinition
Set myQuery = myTrendDef.Query
' Change the query
myQuery.ProdTest = ComboBox1.Value
myTrendDef.Query = myQuery
' Set the definition containing the new query back
Thanks for keeping the thread updated and glad you found the solution!