473,803 Members | 3,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2492
Oops, where I said Data Table View, that should have been Datasheet View.

"Kevin Myers" <Ke********@aus tin.rr.com> wrote in message
news:10******** *****@corp.supe rnews.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
4166
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 starting to crack, columns getting corrupted. Can't handle the volume of data and number of columns. Sql Server has no problem. But displaying the data is the big deal. The end users want to be able to scroll acros a page to the colum of their...
6
2198
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 work on the results of the view (MISView), it can take 15 minutes to run (eek !), however, if I create a temporary table with the data from the view and then use that for the remainder of the query, it runs in approx 20 seconds. Now, I have...
9
10774
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 TABLE_NAME" I get 4 rows returned. In Enterprise manager:
7
6220
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 make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
3
5881
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, ADDR1, ADDR2, ADDR3, CITY, STATE, POSTAL_CODE HAVING COUNT(*) > 2 The applcation snapshot monitor shows: Rows selected = 181
3
4889
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 the best method? Do you have a sample of how to do this?
31
1796
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 returns the rows with the 'New Value in it' shouldnt it be the values before I made the change or have I missed something. r = Ds1.Tables(0).Select(Nothing, Nothing, DataViewRowState.OriginalRows)
5
1681
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 this in essence a table i.e. a collection of rows? The reason I ask is that I wanted to extract from the array of rows
3
1621
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 result too. CREATE procedure ent_tasks_per_user_company ( @companyName as varchar(50), @resourceName as varchar(50) )
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.