Move records in continuous form from a different form (1 Viewer)

Kayleigh

Member
Joined
Sep 24, 2020
Messages
709
Hi

Been looking for resolution for this issue but can't find any clear-cut solutions. Hope you can help!

The problem: I have a continuous form which is directory of all contacts. Double-clicking name opens a single form with all contact details. We would like to move to next or previous contact in the list but it would mean opening the contact list in hidden mode, moving to next record and then re-opening the single form. Is there any seamless way to go about this?

The current code:
Code:
 DoCmd.OpenForm "frmAccountList"
 DoCmd.RunCommand acCmdRecordsGoToNext
 lngID = Forms!frmAccountList!fldContactID
 DoCmd.OpenForm "frmContact", , , "fldContactID=" & lngID
  Forms!frmAccountList.Visible = False
  Me.cmbMember = ""

Sure there's something simple I'm missing here...

Thanks in advance!
 
DoCmd.OpenForm "frmContact", , , "fldContactID=" & lngID

When you do the above all that does is apply a filter to the form. So you could have a button or some event to turn off the filter
Code:
Me.Filteron = false

The other way is to open the form to all records but go to the desired record instead of opening the form filtered.

in Openargs you pass in the lngID, to frmcontact. In frmContact in the onload event do something like
Code:
if (me.OpenArgs & "") <> "" then me.recordset.movefirst "fldContactID = " & me.openargs
 

Users who are viewing this thread

Top Bottom