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
|
Option Compare Database
Private Sub active(auto As Integer)
Dim strFiltre As String
If auto = 1 Then
Me.ajout.Enabled = True
Me.CarteElement.Visible = True
strFiltre = "([ID_CARTE] LIKE '" & Nz(DMax("id_carte", "ELEMENT"), 0) & "')"
With Me.ClientCommandeCarte.Form
.Filter = strFiltre
.FilterOn = True
End With
End If
End Sub
Private Sub ajout_Click(bob As Integer)
Dim rqSQL1 As String
Dim rqSQL3 As String
Dim couleur As String
Dim police As String
couleur = DLookup("CODE_RVB", "COULEUR", "NOM_COU=" & Chr(34) & Me.COU & Chr(34))
police = DLookup("ID_POLICE", "POLICE", "NOM_POL=" & Chr(34) & Me.POL & Chr(34))
If Not IsNull(Me.CON) And IsNumeric(Me.TAI) And IsNumeric(Me.PV) And IsNumeric(Me.PH) Then
rqSQL1 = ("INSERT INTO TEXTE(ID_TEXTE,CODE_RVB,ID_POLICE,CONTENU_TEX,TAILLE_TEX) VALUES('" & Nz(DMax("id_texte", "TEXTE"), 0) + 1 & "'," & couleur & "," & police & ",'" & Me.CONTENU_TEX & "','" & Me.TAILLE_TEX & "')")
rqSQL3 = ("INSERT INTO ELEMENT(ID_CARTE,ID_ELEMENT,ID_TEXTE,VERTICAL_ELE,HORIZONTAL_ELE) VALUES('" & Nz(DMax("id_carte", "CARTE"), 0) & "', '" & Nz(DMax("id_element", "ELEMENT"), 0) + 1 & "','" & Nz(DMax("id_texte", "TEXTE"), 0) & "', '" & Me.PV & "','" & Me.PH & "')")
DoCmd.RunSQL (rqSQL)
DoCmd.RunSQL (rqSQL3)
active (1)
Else
MsgBox "Valeur érronée ou manquante"
End If
End Sub
Private Sub nouvelle_Click()
Dim rqSQL1 As String
Dim rqSQL2 As String
Dim rqSQL3 As String
Dim couleur As String
Dim police As String
couleur = DLookup("CODE_RVB", "COULEUR", "NOM_COU=" & Chr(34) & Me.COU & Chr(34))
police = DLookup("ID_POLICE", "POLICE", "NOM_POL=" & Chr(34) & Me.POL & Chr(34))
If Not IsNull(Me.CON) And IsNumeric(Me.TAI) And IsNumeric(Me.PV) And IsNumeric(Me.PH) Then
rqSQL1 = ("INSERT INTO TEXTE(ID_TEXTE,CODE_RVB,ID_POLICE,CONTENU_TEX,TAILLE_TEX) VALUES('" & Nz(DMax("id_texte", "TEXTE"), 0) + 1 & "'," & couleur & "," & police & ",'" & Me.CONTENU_TEX & "','" & Me.TAILLE_TEX & "')")
rqSQL2 = ("INSERT INTO CARTE(ID_CARTE) VALUES('" & Nz(DMax("id_carte", "CARTE"), 0) + 1 & "')")
rqSQL3 = ("INSERT INTO ELEMENT(ID_CARTE,ID_ELEMENT,ID_TEXTE,VERTICAL_ELE,HORIZONTAL_ELE) VALUES('" & Nz(DMax("id_carte", "CARTE"), 0) & "', '" & Nz(DMax("id_element", "ELEMENT"), 0) + 1 & "','" & Nz(DMax("id_texte", "TEXTE"), 0) & "', '" & Me.PV & "','" & Me.PH & "')")
DoCmd.RunSQL (rqSQL1)
DoCmd.RunSQL (rqSQL2)
DoCmd.RunSQL (rqSQL3)
active (1)
Else
MsgBox "Valeur érronée ou manquante"
End If
End Sub |
Partager