Solved

duplicating a record in a grid vfp

Posted on 2014-04-10
2
366 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 41

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now