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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
Private Sub CSignefonctionnel1_Click()
If Me.CPatient Then
Me.RechSignefonctionnel1.Visible = False
Else
Me.RechSignefonctionnel1.Visible = True
End If
RefreshQuery
End Sub
Private Sub CSexe_Click()
If Me.CSexe Then
Me.RechSexe.Visible = False
Else
Me.RechSexe.Visible = True
End If
RefreshQuery
End Sub
Private Sub CAge_Click()
If Me.CAge Then
Me.RechAge.Visible = False
Else
Me.RechAge.Visible = True
End If
RefreshQuery
End Sub
Private Sub CSignefonctionnelA1_Click()
If Me.CSignefonctionnelA1 Then
Me.RechSignefonctionnelA1.Visible = False
Else
Me.RechSignefonctionnelA1.Visible = True
End If
RefreshQuery
End Sub
Private Sub CAncienttraitement1_Click()
If Me.CAncienttraitement1 Then
Me.RechAncienttraitement1.Visible = False
Else
Me.RechAncienttraitement1.Visible = True
End If
RefreshQuery
End Sub
Private Sub RechSignefonctionnel1_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub RechSexe_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub RechAge_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub RechSignefonctionnelA1_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub RechAncienttraitement1_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case Left(ctl.Name, 1)
Case "C"
ctl.Value = -1
Case "Rech"
ctl.Visible = False
End Select
Next ctl
Me.lstResults.RowSource = "Renseingnement"
Me.lstResults.Requery
End Sub
Private Sub RefreshQuery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT * FROM Renseingnement Where Renseingnement!Patient <> 0 "
If Not Me.CPatient Then
SQL = SQL & "And Renseingnement!Patient like '*" & Me.RechPatient & "*' "
End If
If Not Me.CSexe Then
SQL = SQL & "And Renseingnement!Sexe = '" & Me.RechSexe & "' "
End If
If Not Me.CAge Then
SQL = SQL & "And Renseingnement!Age like '*" & Me.RechAge & "*' "
End If
If Not Me.CSignefonctionnelA1 Then
SQL = SQL & "And Renseingnement!SignefonctionnelA1 like '*" & Me.RechSignefonctionnelA1 & "*' "
End If
If Not Me.CAncienttraitement1 Then
SQL = SQL & "And Renseingnement!Ancienttraitement1 = '" & Me.RechAncienttraitement1 & "' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
'Me.lblStats.Caption = DCount("*", "Renseingnement", SQLWhere) & " / " & DCount("*", "Renseingnement")
Me.lstResults.RowSource = SQL
Me.lstResults.Requery
End Sub
Private Sub lstResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmAutoRenseingnement", acNormal, , "[Patient] = " & Me.lstResults
End Sub
Private Sub Commande45_Click()
On Error GoTo Err_Commande45_Click
Dim stDocName As String
stDocName = "Patient"
DoCmd.OpenReport stDocName, acPreview
Exit_Commande45_Click:
Exit Sub
Err_Commande45_Click:
MsgBox Err.Description
Resume Exit_Commande45_Click
End Sub |
Partager