bonjour
A partir d'un bouton placé dans un formulaire "F_Prescriptions", Je remplis des sous formulaires (SF_VVC, SF_perfusion) eux mêmes placés placés dans un sous formulaire SF_Traitement. Tout se passe bien sauf si je demande à l'utilisateur des renseignements par un inputbox. Je n'arrive pas à passer à un nouvel enregistrement dans le sous formulaire SF_perfusion. J'ai essayé toutes les syntaxes, tous les focus mais rien à faire
Ce code fonctionne:
mais avec l'inputbox ça ne fonctionne plus
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
37
38
39
40
41
42
43
44
45
46 Private Sub Commande9_Click() Dim bilan As String Dim Poid As Integer Poid = Forms!F_prescriptions!Poids.Value If IsNull(Forms!F_prescriptions!SF_Traitement!ID_Prescription) Then Forms!F_prescriptions!SF_Traitement!date_prescription = Date ControleDate = Forms!F_prescriptions!SF_Traitement!date_prescription Forms!F_prescriptions!SF_Traitement!SF_VVC!vvc = "VVC1" Forms!F_prescriptions!SF_Traitement!SF_VVC!produit_VVC = "PG5%" Forms!F_prescriptions!SF_Traitement!SF_VVC!dose_VVC = "10 ml/h" DoCmd.GoToControl "SF_Traitement" DoCmd.GoToControl "SF_VVC" DoCmd.GoToRecord , , acNewRec DoCmd.GoToRecord acActiveDataObject, , acNewRec Forms!F_prescriptions!SF_Traitement!SF_VVC!vvc = "VVC2" Forms!F_prescriptions!SF_Traitement!SF_VVC!produit_VVC = "PG5%" Forms!F_prescriptions!SF_Traitement!SF_VVC!dose_VVC = "10 ml/h" 'passe au SF perfusion '1 Forms!F_prescriptions!SF_Traitement!SF_perfusion!Voie_IV = "IVSE" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Medicament_IV = "UMULINE" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Dose_IV = "Protocole" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Heures_IV = "glycémie < 1.7 g/l" DoCmd.GoToControl "SF_traitement" Forms!F_prescriptions!SF_Traitement!SF_perfusion.SetFocus DoCmd.GoToRecord , , acNewRec '2 If Poid < 70 Then Forms!F_prescriptions!SF_Traitement!SF_perfusion!Dose_IV = "20 mg" Else Forms!F_prescriptions!SF_Traitement!SF_perfusion!Dose_IV = "40 mg" End If Forms!F_prescriptions!SF_Traitement!SF_perfusion!Heures_IV = "pour bilan entrées / sorties < 500ml" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Voie_IV = "IVL" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Medicament_IV = "LASILIX" Forms!F_prescriptions!SF_Traitement.SetFocus Forms!F_prescriptions!SF_Traitement!SF_perfusion.SetFocus DoCmd.GoToRecord , , acNewRec End If
J'ai voulu essayé le recordset.addnew mais je ne suis pas à l'aise avec la syntaxe et j'ai une erreur à chaque tentative.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
37
38
39
40
41
42
43
44
45 Private Sub Commande9_Click() Dim bilan As String Dim Poid As Integer Poid = Forms!F_prescriptions!Poids.Value If IsNull(Forms!F_prescriptions!SF_Traitement!ID_Prescription) Then Forms!F_prescriptions!SF_Traitement!date_prescription = Date ControleDate = Forms!F_prescriptions!SF_Traitement!date_prescription Forms!F_prescriptions!SF_Traitement!SF_VVC!vvc = "VVC1" Forms!F_prescriptions!SF_Traitement!SF_VVC!produit_VVC = "PG5%" Forms!F_prescriptions!SF_Traitement!SF_VVC!dose_VVC = "10 ml/h" DoCmd.GoToControl "SF_Traitement" DoCmd.GoToControl "SF_VVC" DoCmd.GoToRecord , , acNewRec DoCmd.GoToRecord acActiveDataObject, , acNewRec Forms!F_prescriptions!SF_Traitement!SF_VVC!vvc = "VVC2" Forms!F_prescriptions!SF_Traitement!SF_VVC!produit_VVC = "PG5%" Forms!F_prescriptions!SF_Traitement!SF_VVC!dose_VVC = "10 ml/h" 'passe au SF perfusion '1 Forms!F_prescriptions!SF_Traitement!SF_perfusion!Voie_IV = "IVSE" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Medicament_IV = "UMULINE" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Dose_IV = "Protocole" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Heures_IV = "glycémie < 1.7 g/l" DoCmd.GoToControl "SF_traitement" Forms!F_prescriptions!SF_Traitement!SF_perfusion.SetFocus DoCmd.GoToRecord , , acNewRec '2 If Poid < 70 Then Forms!F_prescriptions!SF_Traitement!SF_perfusion!Dose_IV = "20 mg" Else Forms!F_prescriptions!SF_Traitement!SF_perfusion!Dose_IV = "40 mg" End If bilan = InputBox("Précisez quel doit-être le bilan entrées/ sorties pour les prochaines 24h" & Chr(13) & "Exemple:" & Chr(13) & "< 500 ml") Forms!F_prescriptions!SF_Traitement!SF_perfusion!Heures_IV = "pour bilan entrées / sorties " & bilan Forms!F_prescriptions!SF_Traitement!SF_perfusion!Voie_IV = "IVL" Forms!F_prescriptions!SF_Traitement!SF_perfusion!Medicament_IV = "LASILIX" Forms!F_prescriptions!SF_Traitement.SetFocus Forms!F_prescriptions!SF_Traitement!SF_perfusion.SetFocus DoCmd.GoToRecord , , acNewRec End If
Merci pour votre aide
Partager