Subject Re: [IBO] How to use IB_GRID to...
Author Geoff Worboys
> i'm looking for an example to show me:

All anyone on the list can really do is answer specific problems,
writing examples to support a particular application is generally
beyond the scope of lists such as this. However...


> 1. invoice-Pos-Grid: how to get a Part-Number, -Price and
> -Text from an Parts-Table into the current IB_Grid-Row
> with typing the Art_nr and leaving the Part-Nr-field with
> enter.

I am presuming the "grid" in question contains the invoice items, and
you want to fill (at least) some of the invoice item fields from a
parts table.

You could drop a TIB_LookupCombo onto the invoice-item grid, which
will be used to select a particular part. If the part details (price
etc) must be dupliced into the invoice item (which is sounds
likely/reasonable, to allow the invoice item to remain constant when
the part list changes) then...

You could attach code to the lookup datasource OnDataChange, so that
when the invoice item dataset is in create/edit mode it will copy the
relevant fields from the current lookup dataset row to the current
invoice items row.


> 2. To show data in a IB_Grid sorted to a Rownumber i use
> a trigger like this:
>
> lfs =invoice
> lfspos =invoice-Positions
> zeile =rownumber
>
> CREATE TRIGGER BI_LFSPOS FOR LFSPOS BEFORE INSERT AS
> BEGIN
> UPDATE LFSPOS SET zeile = Zeile + 1
> WHERE LFS_ID = new.LFS_id AND
> ZEILE >= new.ZEILE AND
> LFSPOS_ID <> new.LFSPOS_ID;
> END

I am not sure I understand what this is about. Why not simply give
the user access to the rownumber field? This way they can re-order
items on the invoice if they want. Or simply sort by part-number or
description or some other logical field.


> I would like to use the grid with its own
> delete/insert/append- Functions.

Technically the grid does not have its own insert/delete functions.
They are dataset functions. Simply drop a TIB_UpdateBar onto the form
and attach it to the same datasource as the grid - and there you have
it.


> How can i do these things?

It seems to me as though you could benefit from working through a few
of the examples and tutorials supplied, or perhaps the user guide
available from the IBO website.


I hope this is of at least some help. It is very difficult to be of
any more help without more complete information, or more specific
problems/issues to discuss.


Geoff Worboys
Telesis Computing