So, is the control txtJobID on the FrmSalesJobSearch form?
You could set it to visible=no and put DoCmd.Close acForm, "FrmSalesJobSearch", acSaveYes in the OnClose of the second form.
Bonnie http://www.dataplus-svc.com
Anne wrote:
[Quoted Text] >I created a simple search on an existing form called FrmSales. The search >opens a search results form which was created from a query. I want the user >to be able to double click a job to select it and return to Form sales with >that job information displayed. It works, what I cannot get to work is >closing the search from. Below is the code: > >Private Sub txtJobID_DblClick(Cancel As Integer) >On Error GoTo Err_JobID_Click > > Dim stDocName As String > Dim stLinkCriteria As String > stLinkCriteria = "[JobID]=" & Me.txtJobID > > stDocName = "FrmSales" > DoCmd.OpenForm stDocName, , , stLinkCriteria > DoCmd.Close acForm, "FrmSalesJobSearch", acSaveYes > >Exit_txtJobID_Click: > Exit Sub > >Err_JobID_Click: > MsgBox Err.Description >' Resume Exit_JobID_Click > >End Sub
-- Message posted via http://www.accessmonster.com
|