1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Public Sub ModifFormScoring(nbVariable As Integer)
Dim lstbox As Control
Dim txtbox As Control
Dim NomfrmScoring As String
Dim i As Integer
Dim hauteur As Long
NomfrmScoring = "SCORING"
hauteur = 500
'J'ouvre le formulaire en mode création
DoCmd.OpenForm NomfrmScoring, acDesign
'nbVariable représente le nombre de listbox et textbox que souhaite l'utilisateur
For i = 1 To nbVariable
Set lstbox = Application.CreateControl(NomfrmScoring, acComboBox, acDetail, "", "", 600, hauteur, 8000, 300)
With lstbox
.Name = "lstQuest" & i
.RowSourceType = "Value List"
End With
Set txtbox = Application.CreateControl(NomfrmScoring, acTextBox, acDetail, "", "", 9000, hauteur, 500, 300)
With txtbox
.Name = "txtbFacteurRisque" & i
End With
hauteur = hauteur + 500
Next i
DoCmd.OpenForm NomfrmScoring
End Sub |
Partager