I made this for my mom to check my sisters math homework
Project filesCode:Option Explicit Dim a As Double Dim sd As Double Dim sc As Double Private Function RoundOff(ByVal value As Double, ByVal digits As Integer) As Double Dim move As Double move = 10 ^ digits RoundOff = CInt(value * move) / move End Functiona Private Sub Command1_Click() On Error Resume Next sc = Text1.Text / Text2.Text sd = RoundOff(CSng(sc), CInt(0)) If sd > sc Then sd = sd - 1 End If a = Text1.Text Mod Text2.Text Label1.Caption = sd & " r " & a Command2.Enabled = True net: Resume Next End Sub Private Sub Command2_Click() On Error Resume Next Text3.Text = sd & " * " & Text2.Text & " = " & Val(Text2.Text * sd) Text3.SetFocus SendKeys Text3.Text & "{Enter}" Text3.Text = Val(Text2.Text * sd) & " + " & a & " = " & Val(Text2.Text * sd + a) End Sub Private Sub Text1_Click() Text1.Text = "" End Sub Private Sub Text2_Click() Text2.Text = "" End Sub
Also: i would like someone to tell me how to use the enter key with text1.text = "Enter"?






Reply With Quote