Vince said:
Hi,
Does anyone have a code for my button on click to run a
macro that deletes abc.txt file?
Please and thank you,
Newbie..
Vince
I may be wrong, but I don't think you can delete a file using a macro
alone. I think you have to use VBA to do it. The VBA code would be
Kill "c:\abc.txt"
So you could set your button's OnClick property to "[Event Procedure]"
and create this procedure (named as if your button were named
"Command1":
Private Sub Command1_Click()
Kill "c:\abc.txt"
End Sub
If your button has to do something else, finishing up with deleting the
file, then the best way to do it would be to write the whole process as
a VBA procedure, rather than using the very limited macro language. Let
me know if you need help with this.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)