C
Codebuster
Subform.Requery-problem is killing me.
In Access 97 i have a form with a subform on it. This subform is a
continuous form. Every record on this continuous form has a button do delete
that specific record. This operation is done by calling a public function
which opens the underlaying table of the subform (with the DAO methode) and
delete the specific record. After this deletion i want the subform only to
show the existing records in de table, so a command a requery of the
subform. If i open de main form and make no changes to the records in the
subform this operation works fine, but.....every record on the subform has
also a checkbox. If i click the checkbox and then call the public
delete-function by pressing the delete button of that record, Access tells
me that only a requery can be done afther the current field is saved. I
don't understant what's happening. Can anyone help me to solve this problem.
This is my deleting code:
Public Function WisAktieHand(AktieID As Long, Volgnummer As Long, AktieDate
As Date, AktieWhere As String, lblAktietekst As String, chkAktie As Boolean)
Dim dbs As Database
Dim rst As Recordset
Dim ctl As Control
Set ctl = Forms!frmplanning!frmPlanItem
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("tblRappel")
rst.FindFirst "AktieID =" & AktieID
With rst
.Delete
.Close
End With
ctl.Requery
End Function
Thank for any help, Edwin Kooijman
In Access 97 i have a form with a subform on it. This subform is a
continuous form. Every record on this continuous form has a button do delete
that specific record. This operation is done by calling a public function
which opens the underlaying table of the subform (with the DAO methode) and
delete the specific record. After this deletion i want the subform only to
show the existing records in de table, so a command a requery of the
subform. If i open de main form and make no changes to the records in the
subform this operation works fine, but.....every record on the subform has
also a checkbox. If i click the checkbox and then call the public
delete-function by pressing the delete button of that record, Access tells
me that only a requery can be done afther the current field is saved. I
don't understant what's happening. Can anyone help me to solve this problem.
This is my deleting code:
Public Function WisAktieHand(AktieID As Long, Volgnummer As Long, AktieDate
As Date, AktieWhere As String, lblAktietekst As String, chkAktie As Boolean)
Dim dbs As Database
Dim rst As Recordset
Dim ctl As Control
Set ctl = Forms!frmplanning!frmPlanItem
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("tblRappel")
rst.FindFirst "AktieID =" & AktieID
With rst
.Delete
.Close
End With
ctl.Requery
End Function
Thank for any help, Edwin Kooijman