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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On closing a popup form force the main form to the popup record 1

Status
Not open for further replies.

rew2009

Technical User
Apr 21, 2009
114
US
I have a main form “frmMAIN” which is controlled by a table tblCLIENTS. Within that main form I use a command button to open a second form “frmSECOND” also controlled by “tblCLIENTS”. I navigate to different records in tblCLIENTS in the “frmSECOND”. Now when I close the “frmSECOND” I want to force the “frmMAIN” to go to the last current record that I was at in the frmSECOND. How would I do that? The following is the code for closing the frmSECOND.

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click


DoCmd.Close

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub


Thanks
 
Code:
Private Sub Command0_Click()
  Forms!frmMAIN.Recordset.FindFirst "[client id field]=" & Me![client id control]
  DoCmd.Close
End Sub

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top