T
Todd
Hi All,
The quick question is does anybody know how to seamlessly substitute a
stored procedure for the regular insert/update process? I can almost
do it using the form.undo and form.refresh commands in the
beforeInsert/beforeUpdate events, but can't seem to get the record
position to return to the last user selected record after the refresh
(refreshing loses the selected record).
That's the basic question, here's my specific details:
I'm trying to create a continuous form that allows the user to easily
enter dates that relate to an Inventory.
Here's a simplified table structure:
Table: Inventory
InventoryID int
Table: InventoryDate
InventoryID
InventoryDate datetime
Here's my simplified query used to populate the form:
SELECT IDate.InventoryID,
IDate.InventoryDate
FROM Inventory AS I
LEFT JOIN InventoryDate AS IDate
ON I.InventoryID = IDate.InventoryID
There may or may not be an InventoryDate record associated with each
Inventory but because of the LEFT JOIN, all the inventory records show
up in the continuous form regardless of wether there is an
InventoryDate record associated with it.
I want the user to be able to enter InventoryDate's next to each
inventory. Access see's this as an update, but really it needs to be
an INSERT if the InventoryDate record doesn't exist.
So...I tried "hijacking" the BeforeUpdate event with some insert code
(using form.undo to stop the regular update process, and form.refresh
to show my newly inserted record).
That all works great except I don't know of any way to determine what
was the last record the user clicked on that triggered the insert. I
can return the focus to the inserted/updated record, but that is
anoying for the user because they have to click twice to go to their
next desired record.
Any ideas on other methods for the hijack, or ways of determing which
record the user selected would be greatly appreciated.
Todd
P.S. I've tried playing around the Current() and Click() events and
haven't been able to find one that gives me the last selected record.
The quick question is does anybody know how to seamlessly substitute a
stored procedure for the regular insert/update process? I can almost
do it using the form.undo and form.refresh commands in the
beforeInsert/beforeUpdate events, but can't seem to get the record
position to return to the last user selected record after the refresh
(refreshing loses the selected record).
That's the basic question, here's my specific details:
I'm trying to create a continuous form that allows the user to easily
enter dates that relate to an Inventory.
Here's a simplified table structure:
Table: Inventory
InventoryID int
Table: InventoryDate
InventoryID
InventoryDate datetime
Here's my simplified query used to populate the form:
SELECT IDate.InventoryID,
IDate.InventoryDate
FROM Inventory AS I
LEFT JOIN InventoryDate AS IDate
ON I.InventoryID = IDate.InventoryID
There may or may not be an InventoryDate record associated with each
Inventory but because of the LEFT JOIN, all the inventory records show
up in the continuous form regardless of wether there is an
InventoryDate record associated with it.
I want the user to be able to enter InventoryDate's next to each
inventory. Access see's this as an update, but really it needs to be
an INSERT if the InventoryDate record doesn't exist.
So...I tried "hijacking" the BeforeUpdate event with some insert code
(using form.undo to stop the regular update process, and form.refresh
to show my newly inserted record).
That all works great except I don't know of any way to determine what
was the last record the user clicked on that triggered the insert. I
can return the focus to the inserted/updated record, but that is
anoying for the user because they have to click twice to go to their
next desired record.
Any ideas on other methods for the hijack, or ways of determing which
record the user selected would be greatly appreciated.
Todd
P.S. I've tried playing around the Current() and Click() events and
haven't been able to find one that gives me the last selected record.