473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

Nov 13 '05 #1
1 2457
Oops, where I said Data Table View, that should have been Datasheet View.

"Kevin Myers" <Ke********@austin.rr.com> wrote in message
news:10*************@corp.supernews.com...
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

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Rich | last post by:
I'm sure it sounds kinda nutty to display 200 columns and 500,000 rows of data. But I have been pulling data from a Lotus Notes database into Sql Server for a while now, but Lotus Notes is...
6
by: Ryan | last post by:
I have a query which is quite complex. It's based on a set of data in a complex view which takes the data from several tables. In this complex query, if I allow the various parts of the query to...
9
by: Rowland Hills | last post by:
I have a table which is returning inconsistent results when I query it! In query analyzer: If I do "SELECT * FROM TABLE_NAME" I get no rows returned. If I do "SELECT COL1, COL2 FROM...
7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
3
by: UDBDBA | last post by:
Hi All: I have a query which is running against large table. The query: SELECT DSRC_ACCT_ID, ADDR1, ADDR2, ADDR3, CITY, STATE, POSTAL_CODE, COUNT(*) FROM ERD.ADDRESSA GROUP BY DSRC_ACCT_ID,...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
31
by: One Handed Man \( OHM - Terry Burns \) | last post by:
My Brain is dead !!!!! I modify a single row in a DataTable By setting the FirstName column in a specific row to another name. ( Without Accepting Changes ). However, this statement still...
5
by: Geoff Jones | last post by:
Hi Suppose we have an array of DataRows e.g. Dim drMyRows() As DataRow = myTable.Rows(0).GetChildRows("PricesCompany") generated via a relationship. The question I have is this. Isn't...
3
by: DarkHades | last post by:
Hi all, I have a stored proc which returns twice the result and I dont know why. Can someone have a look at the following code? BTW, I commented the last SELECT/JOIN, cause that one doubled the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.