I currently have a form that contains a command button, which runs a query (below).
The query selects the record, from a table, based on the selected item in a combo box on the same form that contains the command button (below).
But, I would prefer to have the command button open another form window, which contains a combo box, OK, and Cancel buttons. Then I would like the query to select the same record as the selected item from the combo box on the separate form window. This has worked well with the "On Click" event for reports, which then ran a macro (attached), which in turn opens the form containing a combo box, but cannot do the same with the query only.
Code:
Private Sub Command60_Click()
Dim qryLithLogLinks As Hyperlink
DoCmd.OpenQuery ("qryTrendChartLinks")
DoCmd.RunCommand acCmdOpenHyperlink
DoCmd.Close acQuery, "qryTrendChartLinks", acSaveNo
End Sub
The query selects the record, from a table, based on the selected item in a combo box on the same form that contains the command button (below).
Code:
SELECT tblTrendChartLinks.Trend_charts AS Expr1
FROM tblWell_ID INNER JOIN tblTrendChartLinks ON tblWell_ID.WELL_ID = tblTrendChartLinks.WELL_ID
WHERE (((tblWell_ID.WELL_ID)=[Forms]![frmWellMaintenance]![Combo34]))
But, I would prefer to have the command button open another form window, which contains a combo box, OK, and Cancel buttons. Then I would like the query to select the same record as the selected item from the combo box on the separate form window. This has worked well with the "On Click" event for reports, which then ran a macro (attached), which in turn opens the form containing a combo box, but cannot do the same with the query only.