OVH Cloud OVH Cloud

allowedit d'un sous formulaire sur contrôle onglet

2 réponses
Avatar
zepo
J'essaie d'activer les modifications d'un formulaire et de=20
son sous-formulaire plac=E9 sur un contr=F4le onglet via le=20
bouton =E0 cocher d'un autre formulaire. Manifestement je=20
n'arrive pas =E0 indiquer correctement en vba mon sous-
formulaire. La proc=E8dure suivante me permet bien de=20
modifier les champs du formulaires une fois la checkBox=20
cocher mais cela ne me donne pas acc=E9s au modification de=20
mon sous-formulaire....Merci d'avance

Private Sub LockButton_Click()
On Error GoTo Err_LockButton_Click
If (Forms!FORM_MODELE.AllowEdits =3D False) Then
Forms!FORM_MODELE.AllowEdits =3D True
Else
Forms!FORM_MODELE.AllowEdits =3D False
End If
If (Forms("FORM_MODELE")("SFORM_CONTACT") =3D False) Then
Forms("FORM_MODELE")("SFORM_CONTACT").AllowEdits =3D True
Else
Forms("FORM_MODELE")("SFORM_CONTACT").AllowEdits =3D=20
False
End If

Exit_LockButton_Click:
Exit Sub
Err_LockButton_Click:
MsgBox Err.Description
Resume Exit_LockButton_Click
End Sub

2 réponses

Avatar
Raymond
Bonjour.

si SFORM_CONTACT est le sous-formulaire, If
(Forms("FORM_MODELE")("SFORM_CONTACT") = False) ne peut pas fonctionner, le
sous-formulaire ne pouvant pas avoir le valeur True/False.
essaie plutôt:
If Not Forms("FORM_MODELE")("SFORM_CONTACT").Form.allo Then
Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits = True
Else
Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits = False
End If

--
@+
Raymond Access MVP.
http://access.seneque.free.fr/
http://access2003.free.fr/
http://users.skynet.be/mpfa/charte.htm pour une meilleure
efficacité de tes interventions sur MPFA.


"zepo" a écrit dans le message de
news:113901c38be5$3a1e9400$

J'essaie d'activer les modifications d'un formulaire et de
son sous-formulaire placé sur un contrôle onglet via le
bouton à cocher d'un autre formulaire. Manifestement je
n'arrive pas à indiquer correctement en vba mon sous-
formulaire. La procèdure suivante me permet bien de
modifier les champs du formulaires une fois la checkBox
cocher mais cela ne me donne pas accés au modification de
mon sous-formulaire....Merci d'avance

Private Sub LockButton_Click()
On Error GoTo Err_LockButton_Click
If (Forms!FORM_MODELE.AllowEdits = False) Then
Forms!FORM_MODELE.AllowEdits = True
Else
Forms!FORM_MODELE.AllowEdits = False
End If
If (Forms("FORM_MODELE")("SFORM_CONTACT") = False) Then
Forms("FORM_MODELE")("SFORM_CONTACT").AllowEdits = True
Else
Forms("FORM_MODELE")("SFORM_CONTACT").AllowEdits False
End If

Exit_LockButton_Click:
Exit Sub
Err_LockButton_Click:
MsgBox Err.Description
Resume Exit_LockButton_Click
End Sub
Avatar
Zepo
Merci beaucoup, cela fonctionne très bien (j'ai à peine
changé, je le colle au cas où quelqu'un d'autre est
intéressé).

If Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits =
False Then
Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits =
True
Else
Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits =
False
End If




-----Message d'origine-----
Bonjour.

si SFORM_CONTACT est le sous-formulaire, If
(Forms("FORM_MODELE")("SFORM_CONTACT") = False) ne peut
pas fonctionner, le

sous-formulaire ne pouvant pas avoir le valeur True/False.
essaie plutôt:
If Not Forms("FORM_MODELE")("SFORM_CONTACT").Form.allo
Then

Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits
= True

Else
Forms("FORM_MODELE")("SFORM_CONTACT").Form.AllowEdits
= False

End If

--
@+
Raymond Access MVP.
http://access.seneque.free.fr/
http://access2003.free.fr/
http://users.skynet.be/mpfa/charte.htm pour une meilleure
efficacité de tes interventions sur MPFA.


"zepo" a écrit dans le message de
news:113901c38be5$3a1e9400$

J'essaie d'activer les modifications d'un formulaire et de
son sous-formulaire placé sur un contrôle onglet via le
bouton à cocher d'un autre formulaire. Manifestement je
n'arrive pas à indiquer correctement en vba mon sous-
formulaire. La procèdure suivante me permet bien de
modifier les champs du formulaires une fois la checkBox
cocher mais cela ne me donne pas accés au modification de
mon sous-formulaire....Merci d'avance

Private Sub LockButton_Click()
On Error GoTo Err_LockButton_Click
If (Forms!FORM_MODELE.AllowEdits = False) Then
Forms!FORM_MODELE.AllowEdits = True
Else
Forms!FORM_MODELE.AllowEdits = False
End If
If (Forms("FORM_MODELE")("SFORM_CONTACT") = False) Then
Forms("FORM_MODELE")("SFORM_CONTACT").AllowEdits =
True

Else
Forms("FORM_MODELE")("SFORM_CONTACT").AllowEdits =
False
End If

Exit_LockButton_Click:
Exit Sub
Err_LockButton_Click:
MsgBox Err.Description
Resume Exit_LockButton_Click
End Sub

.