Solved

duplicating a record in a grid vfp

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

23 Experts available now in Live!

Get 1:1 Help Now