Results 1 to 5 of 5
  1. #1
    seweryng is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    5

    Macro with 3 actions

    I want to create macro that:

    1. Run query: "QUT_MJS_WID" which create table
    2. Format fields: "DIFF 2010/2009" and "ABS_DIFF 2010/2009" as percent, in created table.
    3. Add new checkpoint (Yes/No) field in created table.
    4. Save created table.



    I try to do it on main own, but it's far from being what I want.
    Macro is called: M_MJS_WID

    I've attached my db.

    Thanks, Seweryn

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Sorry - didn't look at attachments.

    While a MakeTable query is an embedded feature; modifying fields & adding fields to tables - via code - is a very advanced programming task. Since you are posted as a novice - I just wanted to inquire as to whether or not you are indeed? I could point you toward a vba textbook.....

    Otherwise it begs the question of why you are (or think you need to be..)modifying table structure on-the-fly...?

  3. #3
    seweryng is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    5
    I'm novice in Access, but I do lot of thinks in Excel, including intermediate macros in VBA. So, I thing I can handle. Depends, how much advance programming it is Anyway, I could try.

    My db is not thoroughbred database. It's rather software that allow me to compare data from two tables. It works like that:
    1. Take two similar field from table 1 and table2 (in my db it k08data09 and k09data10)
    2. Copy them to new tabel (in my db MJS_WID) and compare with formulas. But because difference between values not always means error, that's why I have to create filed (let's call it ERRORdecision) which will allow one's to decide is it or not an error. Because I have to compare lot of tables I want to do it with macro, which will make my solution more flexible.
    3. Gather all error records in one report using "ERRORdecision" field.

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Based on your description; I would recommend that you make the table exist with all the fields you might need. Rather than create more fields on the fly.

    You can then Append or Delete records to this table.

  5. #5
    seweryng is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    5
    OK, I thought about that solution.

    1. How can I create Yes/No field with query?
    2. I have problem with formatting. When I use FormatPercent to get demand format, then IIf formula return only #Error. (According to my db, I need percent formate for fields: "DIFF 2010/2009" and "ABS_DIFF 2010/2009"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  2. VBA Macro
    By DSTR3 in forum Access
    Replies: 1
    Last Post: 11-30-2010, 11:42 AM
  3. Need help with macro
    By abc123 in forum Programming
    Replies: 6
    Last Post: 06-13-2010, 12:34 AM
  4. MACRO help please
    By DianeG in forum Forms
    Replies: 2
    Last Post: 04-20-2010, 07:19 AM
  5. Get Function to run as a macro
    By randolphoralph in forum Programming
    Replies: 11
    Last Post: 01-24-2010, 12:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums