M
Maury Markowitz
I have a database object that represents a "trade", in the stock/bond sense.
Sometimes these trades are split into two parts in our accounting engine,
something the engine doesn't know about. In order to model this I made each
part of the split trade a full trade object of it's own, and keep the two
together with an ID column pointing to the "first part".
For instance...
order id instrument price split id
1000 IBM 45 (null)
1001 GOOG 104 1001
1002 GOOG 104 1001
In this case the IBM order is not split, while the GOOG order is. Note that
both parts of the GOOG split contain the same information, this is important
for the back-end.
I'm trying to use a subform to edit this in an easy manner. When the user
selects either side (which are displayed separately in their blotter) a new
window appears with a subform showing both sides -- so far, so good.
The question I have is how to have the "rest" of the fields, things like
BUY/SELL, the instrument being traded, etc., be copied into both sides when
selected. For instance, when the user selected "IBM" in the case above, the
default behaviour of Access is to apply that change onto the the current
record, in this case, order 1001. I need to apply it to both sides, keeping
1001 and 1002 in sync.
I realize that I could do this with various afterUpdate triggers and such,
but I'm wondering if this case has already been handled? There's not a lot of
docs on subforms.
Sometimes these trades are split into two parts in our accounting engine,
something the engine doesn't know about. In order to model this I made each
part of the split trade a full trade object of it's own, and keep the two
together with an ID column pointing to the "first part".
For instance...
order id instrument price split id
1000 IBM 45 (null)
1001 GOOG 104 1001
1002 GOOG 104 1001
In this case the IBM order is not split, while the GOOG order is. Note that
both parts of the GOOG split contain the same information, this is important
for the back-end.
I'm trying to use a subform to edit this in an easy manner. When the user
selects either side (which are displayed separately in their blotter) a new
window appears with a subform showing both sides -- so far, so good.
The question I have is how to have the "rest" of the fields, things like
BUY/SELL, the instrument being traded, etc., be copied into both sides when
selected. For instance, when the user selected "IBM" in the case above, the
default behaviour of Access is to apply that change onto the the current
record, in this case, order 1001. I need to apply it to both sides, keeping
1001 and 1002 in sync.
I realize that I could do this with various afterUpdate triggers and such,
but I'm wondering if this case has already been handled? There's not a lot of
docs on subforms.