Run a VBA function from a macro (Access 2003)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to write a procedure that, when a button on the main form is
clicked, imports data from an Excel spreadsheet. That works fine. However
the problem comes with checking to see if there is actually data imported.

Here is the problem: I only can get data imported when running a macro, and
I only know how to use an If-Then-Else statement when running a function in
VBA. Now, how can I call a VBA function from a macro?

Any assistance will be greatly appreciated.
 
Create a macro, in the action select "RunCode", on the bottom choose the name
of the function you want to run, select it from the function in your mdb
 
I get the message, "Microsoft Access can't find the name 'DeleteFile' you
entered in the expression." 'DeleteFile' is a function I made in a new
module called "Transfer". Any more ideas? I am much more used to VB
programming than Access Macro or VBA programing!

Thanks,
Al Doug
 
In the function name did you write 'DeleteFile' or DeleteFile ()

You should write DeleteFile()
just a thought
 
Thaks very much, Ofer. That was exactly what I needed. Runs like a champ!
--
Al Doug

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life"
(John 3:16).
 
Back
Top