Viewing/editing macro code

G

Guest

This is probably too simple a question but I seriously haven't been able to
find an answer in forums or MSDN.

I've created a macro in Access which uses TransferText to import a text
datafile, and also alters the data using a set of specifications. I want to
expand this macro to accept user inputs telling it in which folder to look
for the text file. All I want is to be able to view the VBA code of the macro
I've created as it stands. I can then make the changes I want to. I'd prefer
t be able to this as I'm not yet confident with VBA programming from scratch
with only code. Is this possible at all, I've tried quite a few things like
exporting,etc.....
 
B

Brendan Reynolds

There isn't any VBA code to view, Mike. Unlike other Office applications, in
Access macros and VBA are separate and very different.

You can convert a macro to VBA code. Right-click the macro in the database
window, choose Save As, and choose Module from the 'As' list. It's a one-way
street, though - there's no way to convert VBA code back into a macro.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
G

Guest

Brendan,

Thanks. What is the difference between a macro and a module in this case? Is
it just that a module can be edited as VBA code while a macro can't?

Mike M
 
B

Brendan Reynolds

I'm not sure where to begin to answer that question. It's easier to say what
are the similarities than what are the differences. They are both ways of
automating an operation (or series of operations) in Microsoft Access. And
that's about as far as the similarities go. One is a point-and-click,
graphical method, easy to use but limited. The other is a more manual,
code-intensive method, not quite so easy to use (but still much easier than
many other programming languages) but very powerful and flexible.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 

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

Top