create a file from access

A

alecarnero

I want to create a file with .pag final with this code, but the code must
take the name from the variable nomearq,

Private Sub Comando5_Click()
Dim fs As Variant
Dim a As Variant
Dim nomearq As String
nomearq = "arquivo1"
Set fs = CreateObject("scripting.FileSystemObject")
Set a = fs.createtextfile("c:\pager\nomearq.pag", True)
a.writeline ("idpag")
a.Close
End Sub


i always have the same output a file named nomearq.pag , when the right
output must be arquivo1.pag, what is wrong in this code ???

Thanks in advance
Alejandro carnero
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top