Duplicating Rows in Data Table View

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin Myers

    Duplicating Rows in Data Table View

    Hello,

    I'm an experienced application developer in some languages (including
    various SQL dialects), but have very little experience with MS Access or
    VBA, and am having trouble figuring out how to even get started with the
    following seemingly simple task...

    I have a table with a composite primary key made up of three columns. The
    lowest level key is a simple numeric identifier, but is not an autonumber
    column. Values from several columns in this table can be combined to
    determine a path and file name for an associated external file. When
    viewing data from this table in the default data table view, and with a
    given record selected, I would like to be able to select a menu item and/or
    an item from a context menu (right mouse button) and have the following
    actions performed:

    1. Copy the values of all columns to a new row.
    2. Change the value of the lowest level column in the primary key to one
    more than the previous maximum value of that column for all rows with the
    same two higher level primary key column values.
    3. Execute an external command to copy and modify the file associated with
    the original row to a new file associated with the new row.

    Can someone please help me to get started with the following:

    1. How can I add a menu item and/or context menu item that is only displayed
    when this table is open?
    2. Is it correct to assume that this menu item and/or context menu item will
    need to execute some kind of VBA macro?
    3. How do I get started creating this macro, since I don't see a "View Code"
    menu item or something similar?
    4. What kind of code is required to a) obtain column values from present
    row, b) obtain max value of third level key for all rows with same values of
    top two level keys, and c) add new row with desired values?
    5. How can I execute an external application with appropriate command line
    parameters from within this macro?

    Please note that I would like to do all of this in the simplest manner
    possible. If someone can just get me started down the right path, I can
    probably struggle through the help files enough to figure out the remaining
    details.

    Thanks in advance,
    s/KAM



  • Kevin Myers

    #2
    Re: Duplicating Rows in Data Table View

    Oops, where I said Data Table View, that should have been Datasheet View.

    "Kevin Myers" <KevinMyers@aus tin.rr.com> wrote in message
    news:10jp9ki256 eq3c0@corp.supe rnews.com...[color=blue]
    > Hello,
    >
    > I'm an experienced application developer in some languages (including
    > various SQL dialects), but have very little experience with MS Access or
    > VBA, and am having trouble figuring out how to even get started with the
    > following seemingly simple task...
    >
    > I have a table with a composite primary key made up of three columns. The
    > lowest level key is a simple numeric identifier, but is not an autonumber
    > column. Values from several columns in this table can be combined to
    > determine a path and file name for an associated external file. When
    > viewing data from this table in the default data table view, and with a
    > given record selected, I would like to be able to select a menu item[/color]
    and/or[color=blue]
    > an item from a context menu (right mouse button) and have the following
    > actions performed:
    >
    > 1. Copy the values of all columns to a new row.
    > 2. Change the value of the lowest level column in the primary key to one
    > more than the previous maximum value of that column for all rows with the
    > same two higher level primary key column values.
    > 3. Execute an external command to copy and modify the file associated with
    > the original row to a new file associated with the new row.
    >
    > Can someone please help me to get started with the following:
    >
    > 1. How can I add a menu item and/or context menu item that is only[/color]
    displayed[color=blue]
    > when this table is open?
    > 2. Is it correct to assume that this menu item and/or context menu item[/color]
    will[color=blue]
    > need to execute some kind of VBA macro?
    > 3. How do I get started creating this macro, since I don't see a "View[/color]
    Code"[color=blue]
    > menu item or something similar?
    > 4. What kind of code is required to a) obtain column values from present
    > row, b) obtain max value of third level key for all rows with same values[/color]
    of[color=blue]
    > top two level keys, and c) add new row with desired values?
    > 5. How can I execute an external application with appropriate command line
    > parameters from within this macro?
    >
    > Please note that I would like to do all of this in the simplest manner
    > possible. If someone can just get me started down the right path, I can
    > probably struggle through the help files enough to figure out the[/color]
    remaining[color=blue]
    > details.
    >
    > Thanks in advance,
    > s/KAM
    >
    >
    >[/color]


    Comment

    Working...