rivate Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text2.Text = Val(text1.Text)+ Val(Text2.Text) Text3.Text = Val(text2.Text)+ Val(Text3.Text) End If End Sub
Set DB = New ADODB.Connection Set RS = New ADODB.Recordset DB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database password=abc; Data Source=" & App.Path & "\data.mdb" RS.Open "select * from table ", DB, adOpenDynamic, adLockOptimistic RS.Update RS!recette_jour = Text2.Text RS!recette_glob = Text3.Text RS.Update End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim sum As Long Private Sub Text1_KeyPress(KeyAscii As Integer) If ((KeyAscii < 48) And (KeyAscii <> 8) Or (KeyAscii > 57)) Then Text1.Locked = True Else Text1.Locked = False End If If ((KeyAscii >= 48) And (KeyAscii <= 57)) Then sum = sum + Val(Chr(KeyAscii)) End If 'si tu efface avec le backspace If (KeyAscii = 8) Then sum = sum - Val(Text1.Text) Mod 10 End If If KeyAscii = 13 Then Text2.caption = sum End If End Sub