first simple macro

G

ganderson

I have a repetitive task that I would like to create a
macro to complete. The task is to simply find and
replace a portion of a record in a particular field.

Currently I do this manually with the find and replace
function and each time, im looking for and replacing the
same values with each new table that i import.

Is there a way to create a macro to do this. If so,
could you provide me with a brief example of what this
might look like. I think with a little idea of what it
looks like i might be able to gain some insights and
complete my task.

Any help will be appreciated
 
C

Casey

If you want to use a macro to perform updating of records,
I would recommend that you create a new query. The query
should be of an update type, in other words the query
should be an update query. When in design view of the new
query you can select the query type you want it to be from
the tools menu at the top of the screen. Next, use the
the table that you are updating as the source for that
query. Place the fields that you are interested in
updating and using as criteria for the update in the query
columns. Place the update to information in the Update To
specification for the field to be updated. Place the
criteria in the Criteria specification for the field to be
used as criteria as record selection if needed. Then
after your query is ready, create your macro, in the
design mode of the macro, select the action openquery,
then specify at the bottom of the screen the update query
that you have created. Then you're all set. You can
assign the macro to a button or a property of a form to
activate it as needed. When figuring what pieces of the
field you are using as criteria in your update query you
may want to resort to the MID function. That function may
also serve you in the way of the Update To specification
of your update query. Look up MID in Help and you can
find some really good examples.

This should put you on the right track.

Casey
 

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