What do I need to add to the following code so that they can only enter a whole number and no text into the textbox in a subform.
If they dont enter a number then I want it to display a message. If they do enter a number then I want it to save it to the Speed.ini file.
I've been trying the If Else statement but I can't get it to work.
Private Sub Form_Load()
Open "c:\Program Files\PPortLC1\Data\Speed.ini" For Input As #1
Line Input #1, T1
Speed.Text = T1
Close #1
End Sub
Private Sub Quit_Click()
Call PPortLC1.Close_Forms
Call PPortLC1.Open_PPortLC1_Form
End Sub
Public Sub Save_Click()
Open "c:\Program Files\PPortLC1\Data\Speed.ini" For Output As #1
T1 = CInt(Speed.Text)
Write #1, T1
Close #1
Call PPortLC1.Close_Forms
Call PPortLC1.Open_PPortLC1_Form
End Sub
Thanks for any help
Gary
If they dont enter a number then I want it to display a message. If they do enter a number then I want it to save it to the Speed.ini file.
I've been trying the If Else statement but I can't get it to work.
Private Sub Form_Load()
Open "c:\Program Files\PPortLC1\Data\Speed.ini" For Input As #1
Line Input #1, T1
Speed.Text = T1
Close #1
End Sub
Private Sub Quit_Click()
Call PPortLC1.Close_Forms
Call PPortLC1.Open_PPortLC1_Form
End Sub
Public Sub Save_Click()
Open "c:\Program Files\PPortLC1\Data\Speed.ini" For Output As #1
T1 = CInt(Speed.Text)
Write #1, T1
Close #1
Call PPortLC1.Close_Forms
Call PPortLC1.Open_PPortLC1_Form
End Sub
Thanks for any help
Gary