-
FlexPro
- Zoom sur FlexPro
- Fonctionnalités & Options
- Domaines d’application
- Tous les avantages
- Nouveau dans FlexPro 2021
- Testez FlexPro gratuitement
- FlexPro View OEM Freeware
- Conseils d’achat
- Login
- Langue
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produits
- News
- Support
- Société
- Emplois
- Contact
- Login
- Langue
- +49 6894 929600
- infoweisang.com
- Google Maps
Accueil > Community > Automation and VBA > Liste déroulante avec objet différent en VBA > Reply To: Liste déroulante avec objet différent en VBA
June 26, 2008 at 11:32 pm
#8601
Bernhard Kantz
Participant
Try this code:
ActiveDatabase.ActiveObject.Cursor(fpCursorMinX).Active = True
p1 = ActiveDatabase.ActiveObject.ActiveCursor.PositionIndex
ActiveDatabase.ActiveObject.Cursor(fpCursorMaxX).Active = True
p2 = ActiveDatabase.ActiveObject.ActiveCursor.PositionIndex
ActiveDatabase.ActiveObject.CursorActive = False
Dim Moy As StatisticQuantityAnalysis
Set Moy = ActiveDatabase.ActiveFolder.Add("Moy", fpObjectTypeStatisticQuantity)
With Moy
.DataSet = "beber[" & CStr(p1) & "," & CStr(p2) & "]"
.Quantity = fpStatisticQuantityArithmeticMean
.Update
End With
But in this case it’s easier to use FPScript instead of VBA!
1) Create a FPScript formula ‘beberSection’:
(beber)[Diagram.2D.Cursor(fpCursorMinX, 1).PositionIndex, Diagram.2D.Cursor(fpCursorMaxX, 1).PositionIndex]
2) Create a Mean analysis object with the data set ‘beberSection’.
If you change the position of the cursors FlexPro automatically recalculates the mean value of the new data part.