[AccessD] ERROR going to first record Sometime?

Mark A Matte markamatte at hotmail.com
Tue Jan 2 09:14:18 CST 2007


Hello All,

I'll try to ask this a simple as possible.  I have a form in A97 that has a 
combo box and a subform.  The subform is continuos and is filtered anytime 
the combo is updated.  If I was on the 4th record on the subform and I 
changed the combo...when the sub refreshed it would also be on the 4th 
record.  I needed to go back to the first record each time.  So I added the 
code below:

Dim rs As DAO.Recordset
Set rs = sfrmView.Form.RecordsetClone
rs.MoveFirst
sfrmView.Form.Bookmark = rs.Bookmark
NoRecord:
Set rs = Nothing
**********
This works fine if I move to a different record each time before changing 
the combo.  If I just change the combo I get an error during the refresh of 
the subform "Runtime error 3020, Update or CancelUpdate without AddNew or 
Edit".  The line of code is on the 'Form_BeforeUpdate' of the subform.  If I 
use the code above...What would I add to determine if I were already on the 
first record...or what are other approaches to the same solution?

Thanks and Happy New Year,

Mark A. Matte

_________________________________________________________________
Type your favorite song.  Get a customized station.  Try MSN Radio powered 
by Pandora. http://radio.msn.com/?icid=T002MSN03A07001




More information about the AccessD mailing list