A
Andy
Hi;
It is time to overcome this obstacle.
Have an sfrm, (datasheet), that records what a customer purchases; both
inventory items and services. The user selects either inventory item or
services from a combo box list, (cbxProductType), then selects an item from
a second combo box, then enters the quantity. When the control txtQty loses
focus it triggers an Update qry that removes that many inventory items from
stock. That works perfectly.
If the user must remove a record from the sfrm the products have to be
returned to stock so the Update qry was reversed, (instead of minusing it
added).
To trigger that qry created a cmdbutton. It also works perfectly.
Now the obstacle.
Want to have the cmdbutton also automatically remove that particular record
from the sfrm.
Know that DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord will
select that record, but when the user clicks on the cmdbutton he is no
longer in the sfrm he is on the parent.
Believe that the answer is to create a bookmark when cbxProductType gets the
focus and then have the cmdbutton trigger an event that goes to that
bookmark after it triggers the update qry to return the items to stock.
Have read and read and read and read and read and want to finish this before
the next ice age. Have tried modifying examples from Microsoft and just not
getting it.
Have tried this: (Tried many more, this seems closest)
In txtQty_GotFocus:
Dim varBookmark As Variant
varBookmark = .Bookmark
In cmdButton_Click
Dim varBookmark As Variant
Bookmark = varBookmark
Err msg returning."Not a valid bookmark".
Would someone be so kind to point me in the correct direction. Is there a
better solution?
Thank You.
Andy
It is time to overcome this obstacle.
Have an sfrm, (datasheet), that records what a customer purchases; both
inventory items and services. The user selects either inventory item or
services from a combo box list, (cbxProductType), then selects an item from
a second combo box, then enters the quantity. When the control txtQty loses
focus it triggers an Update qry that removes that many inventory items from
stock. That works perfectly.
If the user must remove a record from the sfrm the products have to be
returned to stock so the Update qry was reversed, (instead of minusing it
added).
To trigger that qry created a cmdbutton. It also works perfectly.
Now the obstacle.
Want to have the cmdbutton also automatically remove that particular record
from the sfrm.
Know that DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord will
select that record, but when the user clicks on the cmdbutton he is no
longer in the sfrm he is on the parent.
Believe that the answer is to create a bookmark when cbxProductType gets the
focus and then have the cmdbutton trigger an event that goes to that
bookmark after it triggers the update qry to return the items to stock.
Have read and read and read and read and read and want to finish this before
the next ice age. Have tried modifying examples from Microsoft and just not
getting it.
Have tried this: (Tried many more, this seems closest)
In txtQty_GotFocus:
Dim varBookmark As Variant
varBookmark = .Bookmark
In cmdButton_Click
Dim varBookmark As Variant
Bookmark = varBookmark
Err msg returning."Not a valid bookmark".
Would someone be so kind to point me in the correct direction. Is there a
better solution?
Thank You.
Andy