open record based on search form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Allen Browne's search form.
The form (for Items) displays the results in a datasheet view.

I'd like to allow the user to "open" the "item" form and show the record the
user selects from the search results on the search form, because the "item"
form has a few calculated fields I can't show on the search form.

Thank you for any suggestions!!!
 
Does this help? The user double clicks on a record (in the search form) to
open the Item form.

Private Sub Form_DblClick(Cancel As Integer) 'Opens the "item" form at the
selected record for edit

Dim stDocName As String
Dim strItemNumber As String
Dim strThisForm As String
stDocName = "frmItem"
strThisForm = "frmSearch"
DoCmd.OpenForm stDocName, , , "tblItems.ItemNumber =" &
[Forms]![frmSearch]![tblItems.ItemNumber], acFormEdit
DoCmd.Close acForm, strThisForm

End Sub
 
Back
Top