> Another newbie question from a refugee from Clipperland.
> I am writing a fairly standard routine for data entry of stock for a
retail
> store. It does the following:
> 1. Displays the data entry fields (TDBEdits) mostly
> 2. Displays a panel containing a TEdit field for keyboard entry of the
Stock
> Code
> 3. On Key Press of <Enter>,
> Hides the Stock Code Entry panel
> Locates the appropriate record, and
> cycles through the rest of the data entry fields
> 4. On Key Down of <F10> in any field, calls Procedure ExitStockEntry (see
> below) which
> Posts entered data
> Shows the Stock Code Entry panel again and
> Makes the Stock Code Entry field the Active Control ready to
> search for the next record
> Problem is, after Procedure ExitStockEntry, although the Stock Code Entry
> panel and Edit window are visible and the cursor is positioned in the Edit
> window, the cursor is not blinking and a keypress or mouse click is needed
> before the cursor blinks and is ready to accept keyboard input.
> I can't find any properties of StockCodeEntry which are not set properly
at
> the time (eg. Enabled, etc.). One thing, though: While StockCodeEntry is
in
> this state of suspended animation, the first item on the Menu Bar at the
top
> of the Form is displayed as depressed. Passing the mouse cursor over it
> un-presses it but does not fix the StockCodeEntry situation. (F10 does not
> call the Menu Bar, by the way.)
> So... any ideas - anything obvious come to mind? See below for the
> procedure which leaves StockCodeEntry in this state.
> ------------------------------------------
> procedure TForm1.ExitStockEntry(Sender: TObject);
> begin
> DataModule2.Stock.Edit;
> DataModule2.Stock.Post;
> Form1.Panel4.Visible := True;
> Form1.StockCodeEntry.Visible := True;
> Form1.StockCodeEntry.Text := '';
> Form1.ActiveControl := Form1.StockCodeEntry;
> end;
> --------------------------------------------
> By the way, when I first tried to compile the app with this procedure call
> in it, I got the error message "Not enough real parameters". I hadn't
> intended the procedure to have parameters, but evidently Delphi thinks it
> does. As an experiment I passed it the name of the Active Control from
whose
> Event Handler the procedure was called, eg. Procedure
> TForm1.ExitStockEntry(EditDepartment) or Procedure
> TForm1.ExitStockEntry(EditItemCode). That satisfied the compiler but left
me
> with the runtime hangup I have described.
> Thanks for kind help in weeks past, and in advance for this one
> Sincerely
> Peter Lawrance
> POSability Software
> Email: p...@seol.net.au
> PO Box 3353 Mount Gambier SA 5290
> Australia
> Bite off more than you can chew - then chew like hell!