Brian the Fish
New member
- Local time
- Today, 12:02
- Joined
- Feb 28, 2010
- Messages
- 2
I am kind of new to VB programming and need to create a program to do the following:
"In Microsoft Access Write a program to convert "test.txt" to a tab delimited file.
All fields must be trimmed of extra spaces.
Include a form to specify the input and output and a button to run the conversion."
I found the following program that seems to do what I need but I am not sure how to create the form and buttons. Can anyone help.
Dim strInputString As String
Dim strOutputString As String
Dim varSplit As Variant
Dim intUB As Integer
Dim intCount As Integer
Open strInputFile For Input As #1
Open strOutputFile For Output As #2
Do Until EOF(1)
Line Input #1, strInputString
varSplit = Split(strInputString, "|", , vbTextCompare)
intUB = UBound(varSplit)
intCount = 0
While intCount <> intUB + 1
strOutputString = strOutputString & varSplit(intCount) & Chr(9)
intCount = intCount + 1
Wend
Print #2, strOutputString
strOutputString = ""
intUB = 0
Loop
Close #1
Close #2
End Sub
"In Microsoft Access Write a program to convert "test.txt" to a tab delimited file.
All fields must be trimmed of extra spaces.
Include a form to specify the input and output and a button to run the conversion."
I found the following program that seems to do what I need but I am not sure how to create the form and buttons. Can anyone help.
Dim strInputString As String
Dim strOutputString As String
Dim varSplit As Variant
Dim intUB As Integer
Dim intCount As Integer
Open strInputFile For Input As #1
Open strOutputFile For Output As #2
Do Until EOF(1)
Line Input #1, strInputString
varSplit = Split(strInputString, "|", , vbTextCompare)
intUB = UBound(varSplit)
intCount = 0
While intCount <> intUB + 1
strOutputString = strOutputString & varSplit(intCount) & Chr(9)
intCount = intCount + 1
Wend
Print #2, strOutputString
strOutputString = ""
intUB = 0
Loop
Close #1
Close #2
End Sub