Solved

duplicating a record in a grid vfp

Posted on 2014-04-10
2
402 Views
Last Modified: 2014-04-10
Hi: I have a table of bank payments, and open this in a grid on a form. I can then allocate each record to an account - eg electricity bill to energy account. Some payments need splitting  - some may have VAT, for example- so I am looking for a button on each row of the grid that, when clicked, duplicates that specific record. I can then amend the original and duplicate values into the constituent costs that make up the original total. Thus a bill for £120 can be changed to 2 records each of £120, which I can change to £100 and £20, then allocate accordingly.
Is this something that vfp can do, does anybody know? I am looking at copyToArray then returnFromArray but have heard of SCATTER? And not sure how to select that specific record on the grid?
Thanks!
0
Comment
Question by:ClaytonGlass
2 Comments
 
LVL 42

Accepted Solution

by:
pcelba earned 400 total points
ID: 39990963
Yes, this is relatively easy:

Staying at the given record (in given workarea) issue:

SCATTER MEMO NAME loDataRecord   && loDataRecord is a local variable which you have to declare

and now you may update the stored values:
loDataRecord.Amount = $20
REPLACE Amount WITH Amount - $20

and finally insert a new record into the grid table:

INSERT INTO YourTableAlias FROM NAME loDatRecord

and finally refresh the grid contents:

THISFORM.YourGrid.SetFocus   && The selected record will be the new one

So the only remaining problem is to enter the $20 amount somehow... You may use additional column in the grid, you may call INPUTBOX etc.
0
 

Author Closing Comment

by:ClaytonGlass
ID: 39991009
Excellent as per usual, pcelba!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
read data from dbf file 6 450
SQL 2012 Permissions Problem 40 427
Copying a DBF file fails 9 268
Delphi Dbf export problem to a Visual Foxpro application 6 208
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Read about why it is more lucrative for an IT company to participate in government projects.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question