O
oscarc
I m currently wanting to automate a procedure through Access, using
Visual Basic.
A report is ran with another program, which then converts it to .txt
file.
I want to create a module to grab this txt file, to delim report, and
put tables into it. Then wanting to e-mail it to the appropriate
person.
So far I have the following:
Public Function ImportMthExtFile()
DoCmd.SetWarnings False
'DoCmd.DeleteObject acTable, "MthExtract"
DoCmd.TransferText acImportDelim, "MthExtractImport",
"c:\MthExtract.txt", -1 (I get an error messages here, telling me, you
cannot import this file)
'Dim dbs As Database
'Dim tbl As TableDef
Set dbs = CurrentDb()
Set tbl = dbs.TableDefs("MthExtract")
tbl.Fields.Append tbl.CreateField("Month", dbText)
tbl.Fields.Append tbl.CreateField("Year", dbInteger)
DoCmd.OpenQuery "qupdMthExtractMonthYear", acNormal, acEdit
DoCmd.SetWarnings True
End Function
Anyones help will be much appreciated..Need help!
Visual Basic.
A report is ran with another program, which then converts it to .txt
file.
I want to create a module to grab this txt file, to delim report, and
put tables into it. Then wanting to e-mail it to the appropriate
person.
So far I have the following:
Public Function ImportMthExtFile()
DoCmd.SetWarnings False
'DoCmd.DeleteObject acTable, "MthExtract"
DoCmd.TransferText acImportDelim, "MthExtractImport",
"c:\MthExtract.txt", -1 (I get an error messages here, telling me, you
cannot import this file)
'Dim dbs As Database
'Dim tbl As TableDef
Set dbs = CurrentDb()
Set tbl = dbs.TableDefs("MthExtract")
tbl.Fields.Append tbl.CreateField("Month", dbText)
tbl.Fields.Append tbl.CreateField("Year", dbInteger)
DoCmd.OpenQuery "qupdMthExtractMonthYear", acNormal, acEdit
DoCmd.SetWarnings True
End Function
Anyones help will be much appreciated..Need help!