[AccessD] Old problem - forgotten the answer

Stephen stephen at bondsoftware.co.nz
Sun Nov 18 13:59:24 CST 2007


Steve and Rocky, 

this combination sounds like what I want.  Will try it this afternoon
and let you know.

Cheers
Stephen  

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Schapel
Sent: Monday, 19 November 2007 6:45 a.m.
To: Stephen
Subject: Re: [AccessD] Old problem - forgotten the answer

Stephen,

Therefore, you could do it within the same code that does the Requery. 
It would make it a lot easier to provide help if you could reveal the
names of the forms, and info about the subform's primary key, and the
code you have so far.  But possibly an adaptation of the code Rocky
suggested would do it, e.g....

    DoCmd.RunCommand acCmdSaveRecord
    lngClientGroupID = Me.TheSubformsPrimaryKey   ' assumes number data
type
    With Forms!YourForm!YourSubform.Form
        .Requery
        .RecordsetClone.FindFirst "TheSubformsPrimaryKey = " &
lngClientGroupID
        If .RecordsetClone.NoMatch Then
           MsgBox "Could not return to selected record", vbExclamation
        Else
           .Bookmark = .RecordsetClone.Bookmark
         End If
    End With

Another option woulkd be to use the main form's Activate event. You
described the editing form as a dialog box form.  If it is truly a
dialog form (i.e. it is opened from the main form in acDialog mode),
then possibly the main form's Activate event would be more applicable.

Regards
Steve

Stephen wrote:
> More info.  The Requery is done from the dialog box form.  It 
> requeries the invoking form.
> 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list