Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and Paste Multiple rows

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

Has any body got any idea how I can let the user copy & paste data in multiple rows on a form table? The rows may not be in the same order as in the table due to filters etc..

Any ideas would be a major help as this is causing me some headaches!

thanks in advance,

Woody
 
I can think of several ways to do this, all of them rather dark and unpleasant. Anyway, you will almost certainly have to use a tCursor and copyToArray() in some way. If you look at the help, it should give you some idea of what's involved.

If it was me, I would add a marking row to the end of the table (a logical field), showing it as check boxes on the form. Users could check the rows they want to copy, then click a 'Copy' button and the program could scan the table, copying each marked record to a temp table, then adding them to wherever they need to go after the scan is through.

Mac :)

"Strange women lying in ponds and distributing swords is no basis for a system of government" - Dennis, age 37

mailto:langley_mckelvy@cd4.co.harris.tx.us
 
Woody,

I think Mac's on the right track, though I personally wouldn't use a temporary table. I'd use a TCursor. Something along these lines might be useful for a start:

Code:
var
   tcSource,
   tcTarget  TCursor
endVar

   tcSource.attach( TableFrameName )
   tcSource.edit()
   tcTarget.open( "TABLE2.DB" )
   tcTarget.edit()
   scan tcSource : 
      if tcSource."Selected" then
         tcSource."Selected" = FALSE;
         tcTarget.insertRecord( sourceTC )
         tcSource.unlockRecord()
         tcTarget.unlockRecord()
      endIf
   endScan
   tcTarget.endEdit()
   tcTarget.close()
   tcSource.endEdit()
   tcSource.close()

Mind you, this is off the top of my head, so you'll probably have to fiddle with it a bit, but it outlines the basic approach I'd use to implement Mac's idea, which is probably one of the easiest ways to do this.

Hope this helps...

-- Lance
 
Woody
Footppad has it. Or you could fire a query on the tableframe, or the table attached to the tableframe, to do this.
bcindc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top