Solved

duplicating a record in a grid vfp

Posted on 2014-04-10
2
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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