Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

duplicating a record in a grid vfp

Posted on 2014-04-10
2
Medium Priority
?
470 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 43

Accepted Solution

by:
pcelba earned 1600 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

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…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

704 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