get records from clipboard & populate array

G

Guest

Using Access 2000, I have form with a button that copies a user selected
record or a group of records, that are specs. To save data entry time, they
want to be able to copy the selected records to another location, in the same
table, and paste them. I cannot copy the primary key from the records
because that would create duplicate values. So I would like to paste the
copied records into an array, add new values to satisfy the primary key and
then insert the data into the selected location.

I am at a loss on how to take values from the clipboard and populate an
array with them. Here is my code for the "Copy" button that works fine:

Private Sub Copy_Click()
[Forms]![Permit Limits].[SampLimSub2].SetFocus
Me.Copy.Enabled = False
Me.Select.Enabled = False
Me.Paste.Enabled = True
End Sub

Any help will be greatly appreciated. Thank you.
 
G

Guest

What are you really trying to do? Moving a record or records to a different
location within the same table is a very unusual and probably useless thing
to do?
 
G

Guest

I am rebuilding an old application for a group of users that use this copy
and paste feature to copy laboratory analyte specs from one site to another.
It saves keystrokes when setting up a new location with similar analytical
needs.

Thank you for your interest...

Klatuu said:
What are you really trying to do? Moving a record or records to a different
location within the same table is a very unusual and probably useless thing
to do?

Al said:
Using Access 2000, I have form with a button that copies a user selected
record or a group of records, that are specs. To save data entry time, they
want to be able to copy the selected records to another location, in the same
table, and paste them. I cannot copy the primary key from the records
because that would create duplicate values. So I would like to paste the
copied records into an array, add new values to satisfy the primary key and
then insert the data into the selected location.

I am at a loss on how to take values from the clipboard and populate an
array with them. Here is my code for the "Copy" button that works fine:

Private Sub Copy_Click()
[Forms]![Permit Limits].[SampLimSub2].SetFocus
Me.Copy.Enabled = False
Me.Select.Enabled = False
Me.Paste.Enabled = True
End Sub

Any help will be greatly appreciated. Thank you.
 
G

Guest

I see, so it is not really the same table, but another table with the same
structure. If you are allowing the user to select records directly from the
table, then all that needs to be done is for them to open the table they want
to paste the rows in, go to the automatic new record at the end of the table
and paste the rows there. It will allow multiple rows to be pasted.

Al said:
I am rebuilding an old application for a group of users that use this copy
and paste feature to copy laboratory analyte specs from one site to another.
It saves keystrokes when setting up a new location with similar analytical
needs.

Thank you for your interest...

Klatuu said:
What are you really trying to do? Moving a record or records to a different
location within the same table is a very unusual and probably useless thing
to do?

Al said:
Using Access 2000, I have form with a button that copies a user selected
record or a group of records, that are specs. To save data entry time, they
want to be able to copy the selected records to another location, in the same
table, and paste them. I cannot copy the primary key from the records
because that would create duplicate values. So I would like to paste the
copied records into an array, add new values to satisfy the primary key and
then insert the data into the selected location.

I am at a loss on how to take values from the clipboard and populate an
array with them. Here is my code for the "Copy" button that works fine:

Private Sub Copy_Click()
[Forms]![Permit Limits].[SampLimSub2].SetFocus
Me.Copy.Enabled = False
Me.Select.Enabled = False
Me.Paste.Enabled = True
End Sub

Any help will be greatly appreciated. Thank you.
 
G

Guest

The copied record(s) will go into the same table, its just getting the same
analyte specs from one location for another location that reqires the same
type of specs. I know how to copy and paste records into the new record at
the end of a table but that will not work in this case; it will create
duplicate primary key values.

I would create a selection list but it would contain a couple of hundred
analyte selections. I am copying the record(s) onto the clipboard and want
to know how to get the information into an array so that I can modify the
primary key and then insert the data into new records.

Thanks

Klatuu said:
I see, so it is not really the same table, but another table with the same
structure. If you are allowing the user to select records directly from the
table, then all that needs to be done is for them to open the table they want
to paste the rows in, go to the automatic new record at the end of the table
and paste the rows there. It will allow multiple rows to be pasted.

Al said:
I am rebuilding an old application for a group of users that use this copy
and paste feature to copy laboratory analyte specs from one site to another.
It saves keystrokes when setting up a new location with similar analytical
needs.

Thank you for your interest...

Klatuu said:
What are you really trying to do? Moving a record or records to a different
location within the same table is a very unusual and probably useless thing
to do?

:

Using Access 2000, I have form with a button that copies a user selected
record or a group of records, that are specs. To save data entry time, they
want to be able to copy the selected records to another location, in the same
table, and paste them. I cannot copy the primary key from the records
because that would create duplicate values. So I would like to paste the
copied records into an array, add new values to satisfy the primary key and
then insert the data into the selected location.

I am at a loss on how to take values from the clipboard and populate an
array with them. Here is my code for the "Copy" button that works fine:

Private Sub Copy_Click()
[Forms]![Permit Limits].[SampLimSub2].SetFocus
Me.Copy.Enabled = False
Me.Select.Enabled = False
Me.Paste.Enabled = True
End Sub

Any help will be greatly appreciated. Thank you.
 
G

Guest

I don't know of any way to paste into an array. I doubt in can be done.
The only thought I can offer would be to paste them to a temporary table,
then run an append query that would append them back to the table. You would,
of course, not include the primary key in the append. Then delete the data
from the temporary table.

Al said:
The copied record(s) will go into the same table, its just getting the same
analyte specs from one location for another location that reqires the same
type of specs. I know how to copy and paste records into the new record at
the end of a table but that will not work in this case; it will create
duplicate primary key values.

I would create a selection list but it would contain a couple of hundred
analyte selections. I am copying the record(s) onto the clipboard and want
to know how to get the information into an array so that I can modify the
primary key and then insert the data into new records.

Thanks

Klatuu said:
I see, so it is not really the same table, but another table with the same
structure. If you are allowing the user to select records directly from the
table, then all that needs to be done is for them to open the table they want
to paste the rows in, go to the automatic new record at the end of the table
and paste the rows there. It will allow multiple rows to be pasted.

Al said:
I am rebuilding an old application for a group of users that use this copy
and paste feature to copy laboratory analyte specs from one site to another.
It saves keystrokes when setting up a new location with similar analytical
needs.

Thank you for your interest...

:

What are you really trying to do? Moving a record or records to a different
location within the same table is a very unusual and probably useless thing
to do?

:

Using Access 2000, I have form with a button that copies a user selected
record or a group of records, that are specs. To save data entry time, they
want to be able to copy the selected records to another location, in the same
table, and paste them. I cannot copy the primary key from the records
because that would create duplicate values. So I would like to paste the
copied records into an array, add new values to satisfy the primary key and
then insert the data into the selected location.

I am at a loss on how to take values from the clipboard and populate an
array with them. Here is my code for the "Copy" button that works fine:

Private Sub Copy_Click()
[Forms]![Permit Limits].[SampLimSub2].SetFocus
Me.Copy.Enabled = False
Me.Select.Enabled = False
Me.Paste.Enabled = True
End Sub

Any help will be greatly appreciated. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top