Investment Control Demo

Background

The original purpose was to help a small financial advisor (Tom) manage investments. Tom wanted a table and form for each investment (stock, share etc.) held. Plus summary table and forms. Plus reports. Plus a framework to hold it all together. Some favour! Tom had bought dB2k and wanted to do all he could himself, reminding me that he had written some small dBASE III+ routines 15 years ago!

In fact Tom could not, at first at least, cope with more than the basic use of the Form Design and other tools. Anything else would have to be done for him. However it was soon evident that some fields would be common to every individual investment table and form. If such basic forms could be supplied to him, he reckoned he could modify each one to meet his needs.

Solution

The solution was to auto create all the basic investment tables, the forms that access them and even put a button on a form to call them! At this point both the tables and forms were incomplete, to some extent at least. However Tom could easily add fresh fields to the tables (and delete one or two in some cases). He could then open the FD and drag the additional fields onto the relevant form.

Experienced programmers may ask, why not just one table with all possible fields? And why not one form with parameters that would define what fields to show? Possibly a valid alternative but not one that Tom could maintain himself. And not suitable for this demo either!

Development

The application is still being prepared (it is a spare time job) but rather than wait until finally completed what is ready is being made available for downloading as a sort of early Alpha version. Hopefully some will try it and contribute suggestions that can be incorporated in the final application. Or, if you like, a sort of Open Source project with contributions invoted.

It is also a somewhat simplified version of Tom's application to make it more suitable for demo purposes. As further stages are completed, the download file will be updated.

The Package

The downloadable zip file for the early Alpha version comprise:

IcStart.prg - Startup program
Summary.wfm - the main form at this stage
Summary.dbf and mdx - the summary table for all shares
Summary.rep - the summarised report form
Rsrcust.cfm - the custom form for Summary.wfm
Formctrl.cc - custom controls used
RrSeeker.cc - In effect the normal Seeker file
ZSeeker.cc - The enhanced Seeker
RrCustButt.cc - a modified CustButt.cc
Stansys2.bmp - the logo file
SeqValue.dbf and mdx - table to maintain Id numbers
Preview.wfm - Ken Mayer's report preview form
CustbuttEnglish.h

Alpha Demo, ICSDemo.zip

Usage

Unzip ICSDemo.zip into an empty folder. From dB2k run IcStart.prg, this will open Summary.wfm. Add a new record on the Summary form entering just the investment name, a file name (max 8 chars) and a two character Id code. Then Save (green tick button at top) and accept the offer to build a new form. A new table and form will then be generated. A record will also have been added to the SeqValue table. Note that all Add/Edit options are handled through the buttons at the top of the form. File names are restricted to 8 chars as Tom wants to use a DOS Backup tool.

At this Alpha stage you should now close Summary (you must use the Close Door button) and run the form you have just created. Add a new record to this entering relevant figures. Save and then close the form. Run Summary again and select the Update button. This will copy the data in your new Share table into the corresponding Summary record. Select the View/Print button to see a report.

You will need to add a few investment names to the Summary form and then add at least one record in each of these forms to see the intended overall affect. You will note that adding a record to these forms always repeats the data in the last record. This is because in most circumstances only one item will change, such as current market price. At this point the Summary report will always show the last record entered for each investment. Selection options, such as by date, will be added later. Other planned additions are a report for each investment, a form to select investments through buttons, a grid form to provide a quick facility to just enter the current market price for each investment. And anything else that gets suggested!

Tom intends to use the system to track investments, mainly shares, held by each of a few clients. I believe that in the US what we in the UK call "Shares" are called "Stocks". Some of the modifications Tom will make to each form will allow them to handle other kinds of investment.

Summary

Few are likely to find this demo useful in itself, at least without some modification. The purpose is to illustrate how many of the forms in an application can be at least partially auto created. Even if only two or three fields are common, such as ID fields, it may well be worth auto creating them all first and then just modifying the tables and dragging on all the extra fields. You will then know that each such form is in a similar style and format and is pre-debugged except for any further fields or code that is added.

The Form Generator described on the "Now That's Magic" page will use a similar approach to the form building in this demo but will include provision to select the custom form. table, fields etc.