Private Sub Command1_up_low_Click() Dim inputfilename As String Dim outputfilename As String Dim collectword As String Dim collectword2 As String Dim inputcharacter As String * 1 Dim inputcharacter2 As String * 1 Dim responce As String * 1 Dim inputline As String Dim input_file_find As String Dim output_file_find As String Dim maxlinezise As Variant Dim result As Variant Dim i As Variant Dim firstletter As Integer Dim timein As Variant Dim timeout As Variant Dim counter As Long Dim home_directory As String On Error Resume Next 'vbCrLf line braker timein = Time 'These are the EXTRA OPTIONS selected by the user 'I fixed them some home_directory = Me![directory_name] If (home_directory = "") Then MsgBox "You must enter the DIRECTORY NAME of where your file is at" Exit Sub End If If (Right$(Me![directory_name], 1) = "/") Then MsgBox "Please put a ""\"" at the end of the directory name instead of a ""/"" " Exit Sub End If If (Right$(Me![directory_name], 1) <> "\") Then home_directory = home_directory & "\" End If If (Me![input_file] = "") Then MsgBox "You must type an INPUT file name" Exit Sub End If If (Me![output_file] = "") Then MsgBox "You must type an OUTPUT file name" Exit Sub End If 'Look for "\" or "/" If ((Right$(Me![input_file], 1) = "\") Or (Right$(Me![input_file], 1) = "/")) Then MsgBox "The INPUT file name is invalid, it has a ""\"" or ""/"" at the end" Exit Sub End If If ((Right$(Me![output_file], 1) = "\") Or (Right$(Me![output_file], 1) = "/")) Then MsgBox "The OUTPUT file name is invalid, it has a ""\"" or ""/"" at the end" Exit Sub End If '++++++++++++++++++++++++++++++ 'MsgBox "1" 'On Error Resume Next Dir (home_directory) If Err <> 0 Then MsgBox "Directory does not exist" Exit Sub End If 'MsgBox "2" '++++++++++++++++++++++++++++++++ 'Make sure files are valid input_file_find = Dir$(home_directory & Me![input_file]) If Len(input_file_find) < 1 Then MsgBox "The INPUT file was not found" + vbCrLf + "Make sure the DIRECTORY and INPUT FILE names are valid" Exit Sub End If output_file_find = Dir(home_directory & Me![output_file]) If Len(output_file_find) > 0 Then responce = MsgBox("The OUTPUT file name exist" + vbCrLf + "DO YOU WANT TO CONTINUE", 1) If responce = 2 Then Exit Sub End If On Error Resume Next Open "temp.txt" For Output As #4 If Err <> 0 Then MsgBox ("Could not create temp file") Exit Sub End If 'Cap states If ((Me![Check1]) And ((Len(Dir("state.txt"))) < 1)) Then MsgBox ("The application file ""state.txt"" was not found in the application's directory" & vbCrLf & "Will continue without processing it") ElseIf Me![Check1] Then Open ("state.txt") For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If 'Cap companies If ((Me![Check2]) And ((Len(Dir("company.txt"))) < 1)) Then MsgBox ("The application file ""company.txt"" was not found in the application's directory" & vbCrLf & "Will continue without processing it") ElseIf Me![Check2] Then Open "company.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If 'Cap mix If ((Me![Check3]) And ((Len(Dir("mix.txt"))) < 1)) Then MsgBox ("The application file ""mix.txt"" was not found in the application's directory" & vbCrLf & "Will continue without processing it") ElseIf Me![Check3] Then Open "mix.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If 'Cap countries If ((Me![Check5]) And ((Len(Dir("country.txt"))) < 1)) Then MsgBox ("The application file ""country.txt"" was not found in the application's directory" & vbCrLf & "Will continue without processing it") ElseIf Me![Check5] Then Open "country.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If 'Cap titles If ((Me![Check4]) And ((Len(Dir("title.txt"))) < 1)) Then MsgBox ("The application file ""title.txt"" was not found in the application's directory" & vbCrLf & "Will continue without processing it") ElseIf Me![Check4] Then Open "title.txt" For Input As #5 Do While Not EOF(5) Line Input #5, inputline Print #4, inputline Loop Close #5 End If Close #4 'Open the files inputfilename = (home_directory & Me![input_file]) On Error Resume Next outputfilename = (home_directory & Me![output_file]) On Error Resume Next Open inputfilename For Input As #1 If Err <> 0 Then MsgBox "Failed to open INPUT file" Exit Sub End If Open outputfilename For Output As #2 If Err <> 0 Then MsgBox "Failed to open OUTPUT file" Exit Sub End If Open ("temp.txt") For Input As #3 If Err <> 0 Then MsgBox "Failed to open TEMPORARY file" Exit Sub End If 'Initialize variables inputcharacter = "" inputcharacter2 = "" collectword = "" collectword2 = "" firstletter = 0 counter = 0 'Do your job Do While Not EOF(1) Line Input #1, inputline maxlinezise = Len(inputline) i = 1 Do While i <> (maxlinezise) + 2 inputcharacter = Mid$(inputline, i, 1) i = i + 1 If firstletter = 0 Then inputcharacter = UCase(inputcharacter) firstletter = 1 Else inputcharacter = LCase(inputcharacter) End If collectword = collectword & inputcharacter If inputcharacter = " " Then If collectword <> " " Then counter = counter + 1 'Check for some words formating If Left(collectword, 2) = "Mc" Then Mid$(collectword, 3, 1) = UCase(Mid$(collectword, 3, 1)) ElseIf Left(collectword, 3) = "Mac" Then Mid$(collectword, 4, 1) = UCase(Mid$(collectword, 4, 1)) ElseIf Left(collectword, 2) = "O'" Then Mid$(collectword, 3, 1) = UCase(Mid$(collectword, 3, 1)) ElseIf Left(collectword, 2) = "D'" Then Mid$(collectword, 3, 1) = UCase(Mid$(collectword, 3, 1)) Else 'compare input file(word)to those words in exeptions files Seek #3, 1 Do While Not EOF(3) Line Input #3, collectword2 collectword2 = collectword2 + " " result = StrComp(collectword, collectword2, 1) If result = "0" Then Print #2, collectword2; collectword = "" collectword2 = "" firstletter = 0 Else collectword2 = "" End If Loop End If End If Print #2, collectword; firstletter = 0 collectword = "" End If Loop Print #2, Loop Close #1 Close #2 Close #3 timeout = Time 'Display this message after finishing the entire job MsgBox "The End" & vbCrLf & "Started Running At: " & timein & vbCrLf & "Finished At: " & timeout & vbCrLf & "Words Counted: " & counter End Sub Private Sub Command2_all_up_Click() 'Private Sub All_Upper_Case_Click() Dim inputfilename As String Dim outputfilename As String Dim inputcharacter As String Dim counter As Long Dim timein As String * 15 Dim timeout As String * 15 timein = Time inputfilename = Me![directory_name] & Me![input_file] outputfilename = Me![directory_name] & Me![output_file] Open inputfilename For Input As #1 'input file name Open outputfilename For Output As #2 Do While Not EOF(1) ' Loop until end of file. inputcharacter = Input(1, #1) ' Get one character. Print #2, UCase(inputcharacter); inputcharacter = "" Loop Close #1 Close #2 timeout = Time MsgBox "The End Started Running At: " & timein & " And Finished At: " & timeout ' & " Words Counted: " & counter 'End Sub End Sub Private Sub Command3_fix_chars_Click() Dim inputfilename As String Dim outputfilename As String Dim inputcharacter As String * 1 Dim inputcharacter2 As String * 1 Dim inputline As String Dim maxlinezise As Integer Dim result As Integer Dim i As Integer Dim timein As String * 15 Dim timeout As String * 15 Dim counter As Long Dim bad As Integer timein = Time inputfilename = Me![directory_name] & Me![input_file] outputfilename = Me![directory_name] & Me![output_file] Open inputfilename For Input As #1 Open outputfilename For Output As #2 Open "ascii.txt" For Input As #3 counter = 0 bad = 0 Do While Not EOF(1) Line Input #1, inputline maxlinezise = Len(inputline) i = 1 counter = counter + 1 Do While i <> (maxlinezise) + 2 inputcharacter = Mid$(inputline, i, 1) i = i + 1 If inputcharacter <> " " Then Seek #3, 1 Do While Not EOF(3) inputcharacter2 = Input(1, #3) result = StrComp(inputcharacter, inputcharacter2, 0) If result = "0" Then Print #2, " "; bad = bad + 1 GoTo theend End If Loop End If Print #2, inputcharacter; theend: Loop Print #2, Loop Close #1 Close #2 Close #3 timeout = Time MsgBox "The End" & vbCrLf & "Started Running At: " & timein & vbCrLf & "Finished Running At: " & timeout & vbCrLf & "Lines Counted: " & counter & vbCrLf & "Bad characters found/fixed: " & bad End Sub