Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to fill a list box in a form with unique labels. 4

Status
Not open for further replies.

german12

Programmer
Nov 12, 2001
563
DE
I have a VFP file with about 1500 stock movements which are often repeated.
Filename: aktien2
Field name : ak2begriff (character)


I use this .dbf for a form (called form1)
Init for form1: use aktien2
The form1 has a listbox (called picklist)
I want filled it with unique values of the shares, therefore I filled
these properties for the list box:

RowSource of picklist =
select distinct(ak2begriff) as "ak2begriff" from aktien2

RowSourceType of picklist =
3 (SQL statement).

When I start the form, I see the result of the SQL statement
as a query - and if I click away this display, then the listbox
disappeared.

Then this error message comes:
Cannot access the selected table.
Select distinct(ak2begriff) as "ak2begriff" from aktien2

What is my fault?

Thanks
Klaus


Peace worldwide - it starts here...
 
Thanks Chriss for this view.
It is correct, it is not my intention to load every stock or security to see the price.
There are sophisticated apps that - although they're free - give you information about price trends, provide graphical developments and also show news specific to each paper.
eg "Finanzen100"

My VFP program only evaluates my sales-transactions.
I trade stocks a lot - and I'd like to know everything I've achieved from the sales.
So after a sale deal, I just enter the order-number, the name of the sold stock (e.g. Tesla), the number of sold pieces, the sales price per piece, the date of the sale and the total loss or profit from this deal.
This only takes 10 seconds for a deal although it is manual.

So the number of titles is manageable, but VFP is very good to show me a lot of information on a form or to calculate it:
a) Which paper has brought the greatest profit (or loss) per title, cumulatively or in detail?
b) what does it look like separated by years and months?
c) what about the sales-weekday of all sales?
d) what did the dividends bring?
e) what was the last sale price for a certain security?
... and so on.


So there is only one sales file to maintain or update - that's not a lot of work (one doesn't buy or sell securities every day, but over the course of many years such a file naturally grows - and
it's also reassuring when you can always see how something is developing and whether it's worth continuing or stopping.
And Foxpro can do this a lot easier than Excel, Lotus 1-2-3 or another spreadsheet.
Also concerning the time frame you mentioned - for VFP it is very easy to show you e.g. the last 10 sales when needed. With a spreadsheet that is not comfortable.

Alongside:
If someone tells you that he has only ever won on the stock exchange, then that is a liar - or he doesn't deal in securities at all and his name is Putin.

Klaus

Peace worldwide - it starts here...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top