Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft access macro

Microsoft access macro

Microsoft access macro

Hey Guys,

Hoping for some help creating a macro in Access.
From what I can tell a macro is created using VB, for which I have no clue as to how this works. Here's what im trying to do. I want to run a query, then add a column to the query. I want run a macro that will look at what I type  into the first field of the column and then copy it to all the fields underneath it, the macro should stop pasting when there are no more records to update. In other words If there are 50 records it should stop at 50. Any Ideas?

Thanks, Tom

RE: Microsoft access macro

Can you just use a simple Update Query?

UPDATE Contacts SET Contacts.Department = [New Dept];

will open a dialog box with the question New Dept and then fill in the Department column with the value you type in.

Good Luck
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: Microsoft access macro


Thanks, the update query works great for this application.
I am curious though about how to run macros in Access.
Do you know of a good reference?

Thanks, Tom

RE: Microsoft access macro

Macros can be triggered by events on forms or by going to the "Macros" in Access and selecting the applicable macro.

To do this with a form, open a form in design view , go to the file menu and save the form as something not already in your database, then go to one of the text boxes or other controls on the form and right click, select properties, events tab, onclick, click  the arrow. If you already have a macro in your database the macro should be there. Select it. If not click the ... to the right and choose "macro builder".

DO THIS ON A COPY of an mdb file. Not on the real one.

Hope this helps

Gerald Austin
Iuka, Mississippi

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close