Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft access macro 1

Status
Not open for further replies.

DrumDude

Industrial
Jan 6, 2005
2
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


 
Replies continue below

Recommended for you

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
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

UK steam enthusiasts:
 
John,

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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor