Bonjour ! Voici un bout de code que j'ai écrit afin de pouvoir ouvrir un formulaire selon 2 critères soit Prenom et nom j'ai tenté plusieurs approche mais il n'y a pas grand chose qui fonctionne et même que ma dernière tentative crash access .... En rajoutant (DBopenDynaset) poufff access ne répond plus.
Biensur si vous avez des idées pour changer ma méthode elle est la bienvenue merci de m'aidez à résoudre un autre problématique les amis.
voici le code placé sur le formulaire qui contient les critères :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Private Sub choixpatient_AfterUpdate() Dim choixpatient1 As String Dim choixpatient2 As String choixpatient1 = Me.choixpatient.Column(1) choixpatient2 = Me.choixpatient.Column(2) DoCmd.Close DoCmd.OpenForm "rapportintervention", acNormal, , , , , "" & choixpatient1 & " ; " & choixpatient2 & "" logEntrylIVE ("Ouverture du Rapport d'intervention de " & choixpatient1 & " " & choixpatient2 & "") choixpatient1 = "" choixpatient2 = "" End Sub
Voici le code placé sur le formload du formulaire Rapport d'intervention .
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 Dim identitePatient As Variant Dim PrenomPatientArg As String Dim NomPatientArg As String identitePatient = Split(Me.OpenArgs, ";") prenompatientArg = identitePatient(0) nompatientArg = identitePatient(1) Dim MaTable As dao.Recordset Dim db As dao.Database Set MaTable = CurrentDb.OpenRecordset("tbl_rapportintervention", dbOpenDynaset)'ici j'ai le plantage si je l'enlève j'ai une erreur 3251 "opération non autorisé pour se type d'objet" Do Until MaTable.EOF = True MaTable.FindFirst "[Nompatient] = '" & NomPatientArg & "' AND [Prenompatient] = '" & PrenomPatientArg & "'" 'qui me souligne cette ligne MaTable.MoveNext Loop MaTable.Close End If
Partager