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
| Public Sub cible_coche()
DoCmd.OpenForm "ssform_Liste", acDesign
Dim case_a_cocher, libelle As Control
Dim i As Integer
Dim nb
nb = CurrentDb.OpenRecordset("select count(*) FROM Liste").Fields(0).Value
Dim recordset
For i = 1 To nb
recordset = CurrentDb.OpenRecordset("SELECT * FROM Liste WHERE Ordre_affichage=" & i)
'création de la zone de texte
Set libelle = CreateControl("ssform_Liste", acLabel, , , , , , 2000, 250)
libelle.Top = 200
libelle.Left = 2000 * (i - 1) + 500
libelle.Caption = recordset(1).Value
libelle.TextAlign = 20 ' à modifier pour centrer + renvoi à la ligne
'création de la coche
Set case_a_cocher = CreateControl("ssform_Liste", acCheckBox, , "Nom_Table_associee", , , , 250, 250)
case_a_cocher.Top = 700
case_a_cocher.Left = 2000 * (i - 1) + 500 + 2000 / 2
case_a_cocher.Name = recordset(2).Value
Next
End Sub |
Partager