M
MKammerer
I have a form with a subform that searches my main table and applies a filter.
I use the subform to allow the user to select a record in the filtered list
from the table. Once selected I have several buttons on the main form. Each
of these buttons saves the PK from the subform's table to a table called
global variables on the main form and then allows me to run a select query
based on this "global variables" stored PK and open a new form with the
record's data in it that the user selected from the filtered list. Reason I
do this is the table has too much data to display all together and allowing a
search, select and action button is the easiest way to allow editing of the
records. Anyway my "edit record" button seems to work, it opens the "edit"
form as a popup with the selected record's data and allows for editing and
correctly saves the information back to the original table. The problem
comes when I tried to setup a delete button in the popup "edit" form. I have
used standard coding for the deletion (RunCommand acCmdDeleteRecord) and I
have tried using the wizard's coding:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Problem is that with any of these things the delete action properly deletes
the data from the popup "edit" form's display but the data is still in the
original table. After trying numerous fixes I have discovered that each time
I select the delete button the data being deleted is the record in the
"global variables" table that is storing my PK selected from my search box.
Not sure if this is just a fluke or if that can be used to fix my problem.
Nonetheless any help in this area would be much appreciated.
I use the subform to allow the user to select a record in the filtered list
from the table. Once selected I have several buttons on the main form. Each
of these buttons saves the PK from the subform's table to a table called
global variables on the main form and then allows me to run a select query
based on this "global variables" stored PK and open a new form with the
record's data in it that the user selected from the filtered list. Reason I
do this is the table has too much data to display all together and allowing a
search, select and action button is the easiest way to allow editing of the
records. Anyway my "edit record" button seems to work, it opens the "edit"
form as a popup with the selected record's data and allows for editing and
correctly saves the information back to the original table. The problem
comes when I tried to setup a delete button in the popup "edit" form. I have
used standard coding for the deletion (RunCommand acCmdDeleteRecord) and I
have tried using the wizard's coding:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Problem is that with any of these things the delete action properly deletes
the data from the popup "edit" form's display but the data is still in the
original table. After trying numerous fixes I have discovered that each time
I select the delete button the data being deleted is the record in the
"global variables" table that is storing my PK selected from my search box.
Not sure if this is just a fluke or if that can be used to fix my problem.
Nonetheless any help in this area would be much appreciated.