Verrouiller tous les champs sauf un
Résolu
4rocky4
-
Cyrius -
Cyrius -
Bonjour,
Je voudrais verrouiller tous les champs de mon formulaire de consultation sauf UN, une liste déroulante.
Pour verrouiller tous les champs, j'entre ce code :
For Each Ctl In Me.Controls
If Ctl.ControlType = acTextBox Then
Ctl.Locked = True
Ctl.Enabled = False
ElseIf Ctl.ControlType = acComboBox Then
Ctl.Locked = True
Ctl.Enabled = False
End If
Next Ctl
Et je voudrais donc pouvoir autoriser l'accès et la saisie d'un champ.
Je pensais donc mettre ce code :
For Each Ctl In Me.Controls
If Ctl.ControlType = acTextBox Then
Ctl.Locked = True
Ctl.Enabled = False
ElseIf Ctl.ControlType = acComboBox Then
Ctl.Locked = True
Ctl.Enabled = False
End If
Next Ctl
Me."mon_champ".Enabled = true
Me."mon_champ".Locked = false
Mais ca ne marche pas.
Comment pourrais-je faire ?
Merci
4rocky4
Je voudrais verrouiller tous les champs de mon formulaire de consultation sauf UN, une liste déroulante.
Pour verrouiller tous les champs, j'entre ce code :
For Each Ctl In Me.Controls
If Ctl.ControlType = acTextBox Then
Ctl.Locked = True
Ctl.Enabled = False
ElseIf Ctl.ControlType = acComboBox Then
Ctl.Locked = True
Ctl.Enabled = False
End If
Next Ctl
Et je voudrais donc pouvoir autoriser l'accès et la saisie d'un champ.
Je pensais donc mettre ce code :
For Each Ctl In Me.Controls
If Ctl.ControlType = acTextBox Then
Ctl.Locked = True
Ctl.Enabled = False
ElseIf Ctl.ControlType = acComboBox Then
Ctl.Locked = True
Ctl.Enabled = False
End If
Next Ctl
Me."mon_champ".Enabled = true
Me."mon_champ".Locked = false
Mais ca ne marche pas.
Comment pourrais-je faire ?
Merci
4rocky4
A voir également:
- Verrouiller tous les champs sauf un
- Verrouiller cellule excel - Guide
- Comment verrouiller son whatsapp - Guide
- Comment verrouiller un dossier sur pc - Guide
- Verrouiller clavier ✓ - Forum Windows
- Comment réinitialiser un ordinateur verrouillé - Guide
2 réponses
soit
Me.mon_champ".Enabled = true
Me.mon_champ.Locked = false
soit
Me.("mon_champ").Enabled = true
Me.("mon_champ").Locked = false
quand tu a tapé le poit après le Me --> Me. alors IntelliSense t'ouvre une liste avec toutes les possibilités pour cette form.
Me.mon_champ".Enabled = true
Me.mon_champ.Locked = false
soit
Me.("mon_champ").Enabled = true
Me.("mon_champ").Locked = false
quand tu a tapé le poit après le Me --> Me. alors IntelliSense t'ouvre une liste avec toutes les possibilités pour cette form.
Bonjour,
Est-ce possible de commenter ce code ci svp:
For Each Ctl In Me.Controls
If Ctl.ControlType = acTextBox Then
Ctl.Locked = True
Ctl.Enabled = False
ElseIf Ctl.ControlType = acComboBox Then
Ctl.Locked = True
Ctl.Enabled = False
End If
Next Ctl
Je comprends bien son utilité, mais certains points me semble un peu flou.
Merci d'avance.
Cyrius.
Est-ce possible de commenter ce code ci svp:
For Each Ctl In Me.Controls
If Ctl.ControlType = acTextBox Then
Ctl.Locked = True
Ctl.Enabled = False
ElseIf Ctl.ControlType = acComboBox Then
Ctl.Locked = True
Ctl.Enabled = False
End If
Next Ctl
Je comprends bien son utilité, mais certains points me semble un peu flou.
Merci d'avance.
Cyrius.