[AccessD] ERROR going to first record Sometime?

Mark A Matte markamatte at hotmail.com
Tue Jan 2 09:41:12 CST 2007


Gustav,

I made a mistake in my explanation.  The subform is NOT filtered...it is 
requeried because records have been updated and may need to be 
included/excluded when the combo changes.  So I believe I need requery.

Thanks,

Mark A. Matte


>From: "Gustav Brock" <Gustav at cactus.dk>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: <accessd at databaseadvisors.com>
>Subject: Re: [AccessD] ERROR going to first record Sometime?
>Date: Tue, 02 Jan 2007 16:26:12 +0100
>
>Hi Mark
>
>I think all you need is not to Refresh the subform but to Requery it.
>
>/gustav
>
> >>> markamatte at hotmail.com 02-01-2007 16:14 >>>
>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
>
>
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
The MSN Entertainment Guide to Golden Globes is here.  Get all the scoop. 
http://tv.msn.com/tv/globes2007/




More information about the AccessD mailing list