That is a subroutine procedure, not a module. A module is the container that
holds the subroutine procedure.
To run VBA code from a macro, the procedure in VBA code must be a function,
not a subroutine. Change your procedure to this:
Public Function Delfile()
On Error Resume Next
Kill "x:\test.txt"
End Function
Then use the RunCode action in a macro to run the above function:
Action: RunCode
Function Name: Delfile()
--
Ken Snell
<MSACCESSMVP>
- Show quoted text -
I have followed the steps to create a module called delfile and use
the following string
Sub Delfile()
On Error Resume Next
Kill "x:\test.txt"
End Sub
I then go to the macro and runcode but when I type in delfile() and
run the macro I get the following msg
"The expression you entered has a function name that Microsoft Access
can't find"
When I click on the box where I type the command there is a drop down
box with several choices.
Any help would be great as I know I can run the Module and it works,
just want to build it into my macro.