MaxBid.apr

The Approach file demonstrates how to use LotusScript and SQL to directly manipulate data in dBaseIV files. This is much quicker and more efficient than using macros. No view switching is involved and no finds or sorts are required.

The example used is an auction. Each lot has a start and end date between which bids can be submitted. There's also a reserve amount which bids must reach in order to succeed. When bids are closed, the winning bid is determined for each lot. Tied bids are decided in favour of the earliest. Invoices are generated for successful customers, taking into account that one customer may have multiple winning bids.

The script is in a Global sub named InvoiceBids and is called from the click event of the Invoice Closed Bids button on the Lots form.

It also shows how to get the system short date format using the Windows API and manipulate date strings accordingly. This enables the same code to handle dates whatever the system short date format.

Paul Bent
Northwind IT Systems
paulbent@northwindit.co.uk