By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Find Replace text in a text file thru Access form

P: 1
I have an Access form that will be FTPing information. The FTP info will be using a text file located on the hard drive. This text file will have symbolics in it that will be replaced by entries on the Access form. I am looking for code to open a text file in the background and run a find/replace based on fields on the form.

Thanks.
May 17 '07 #1
Share this Question
Share on Google+
1 Reply


JConsulting
Expert 100+
P: 603
I have an Access form that will be FTPing information. The FTP info will be using a text file located on the hard drive. This text file will have symbolics in it that will be replaced by entries on the Access form. I am looking for code to open a text file in the background and run a find/replace based on fields on the form.

Thanks.
[code (vb)]
Function ModifyTextString(FileIn As String, FileOut As String)
Dim strIn As String
Open FileOut For Output As #2
Open FileIn For Input As #1
Do Until EOF(1)
Line Input #1, strIn
Print #2, Replace(strIn, "REPLACE THIS", "WITH THIS")
Loop
Close #1
Close #2
End Function
[/code(vb)]
May 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.