Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't Requery ADP Form

Status
Not open for further replies.

gkluk

Technical User
Aug 17, 2001
6
0
0
GB
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.
 
Are you shure that the information to requery isn´t in a SubForm??? -------------------------
Regards
JoaoTL
-------------------------

 
Joao,

Thanks for replying. I'm using a fairly simple form based on only one table with no subforms. I did however open the form I'm using from a different form before setting its recordsource property. Does this have something to do with it? I don't see why it should though. Hope you can help.

GKL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top