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

Find a record

Status
Not open for further replies.

orna

Programmer
Apr 2, 2002
314
IL
Hi
I have a sub form on a tab control.
Double Click on this form calls a detail form.
when exit the detail form - it requery the sub form to update it.
I would like to get back to the record i stood on before .

TIA
 
Do I understand correctly?
1 Start in a continuous form (multiple records)
2 Select a record on that form
3 Open a detail form for the selected record
4 Requery the continuous form to show changes
5 Go to the record selected in Step 2

You need to make use of recordsetclone and bookmark. Try 'Help' on those words.


[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
I would not try to use a bookmark as suggested
help file said:
Requerying a form invalidates any bookmarks set on records in the form.

use findfirst. Example

Code:
Private Sub EmployeeID_Click()
  Dim empID As Integer
  Dim strWhere As String
  empID = Me.EmployeeID
  strWhere = "EmployeeID = " & empID
  'code execution stops when you open a dialog form
  DoCmd.OpenForm "frmEmployees", , , strWhere, , acDialog
  'code execution resumes when dialog form closed
  Me.Requery
  Me.Recordset.FindFirst strWhere

End Sub
 
Thanks GKChesterton & MajP
GKChesterton, that's right, The requery performed after changes in the detail form, when it is closed,
but i don't know where to insert the code to return to the line. Only the On Current Triger fires when it is back to the subform.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top