Hi All!
I'm working on an Access ADP with MSDE as the backend and I can't seem to requery my form after I delete a record. My form's recordsource property is set to an SQL statement as follows.
Forms!frmViewBoardData.RecordSource = "SELECT * FROM tblBoardData WHERE ContactID = " & Me.txtContactID & " " & "AND PCB_DateReceived >= GETDATE()-14 ORDER BY PCB_ID DESC"
Requerying the form with me.requery after deleting the current record using DoCmd.RunCommand acCmdDeleteRecord doesn't update the form's recordset. I realised this when I checked the recordcount with me.recordset.recordcount, which was unchanged. What's worrying is that the form's navigation bar does indicate that there is one row less. I need to use the form's updated recordset to fill a combo box for record selection.
In desperation, I tried resetting the recordsource completely with
Me.recordsource = Me.recordsource
which worked. I thought requerying the form does the same but apparently not. I'd really like to find out what I'm doing wrong.
Any explanations?
Thanks
GKL
PS: I'm new at this so any suggestions to improve my posts would also help.
I'm working on an Access ADP with MSDE as the backend and I can't seem to requery my form after I delete a record. My form's recordsource property is set to an SQL statement as follows.
Forms!frmViewBoardData.RecordSource = "SELECT * FROM tblBoardData WHERE ContactID = " & Me.txtContactID & " " & "AND PCB_DateReceived >= GETDATE()-14 ORDER BY PCB_ID DESC"
Requerying the form with me.requery after deleting the current record using DoCmd.RunCommand acCmdDeleteRecord doesn't update the form's recordset. I realised this when I checked the recordcount with me.recordset.recordcount, which was unchanged. What's worrying is that the form's navigation bar does indicate that there is one row less. I need to use the form's updated recordset to fill a combo box for record selection.
In desperation, I tried resetting the recordsource completely with
Me.recordsource = Me.recordsource
which worked. I thought requerying the form does the same but apparently not. I'd really like to find out what I'm doing wrong.
Any explanations?
Thanks
GKL
PS: I'm new at this so any suggestions to improve my posts would also help.