Code:Dim Output Dim intnum As Long Dim x Public Function FileExists(FullName As String) As Boolean FileExists = Len(Dir(FullName)) End Function Private Sub Form_Load() If FileExists("C:\a.dat") Then Dim strItem4 As String Open "c:\a.dat" For Input As #1 Input #1, strItem1 Close #1 Label1.Caption = strItem1 '*********************************************************************************************************************** '*********************************************************************************************************************** intnum = CInt(strItem1) 'I always get a type DisMatch Error Here can Someone Please tell me what I am doing wrong '*********************************************************************************************************************** '*********************************************************************************************************************** intnum = intnum + 1 Label1.Caption = CStr(intnum) Open "c:\a.dat" For Output As #1 Print #1, Label1.Caption Close #1 ProgressBar1.Value = Label1.Caption Label4.Caption = 100 - Label1.Caption Else: Label1.Caption = "1" Open "c:\a.dat" For Output As #1 Print #1, Label1.Caption Close #1 ProgressBar1.Value = Label1.Caption Label4.Caption = 100 - Label1.Caption End If End Sub Private Sub Label1_Change() If Label1.Caption = "100" Then Open "C:\a.dat" For Output As #1 Print #1, "100" Close #1 End End If End Sub




Reply With Quote