Hi,
I have some code (below) for a command button on a form which opens up a second form based on a filter. What I want to do is open the second form based on a parameter query instead of a filter.
Specifically, what I mean is I want to change the underlying query which the second form is based on to include a WHERE condition, and then use a parameter to supply the criteria. Changing the query to a parameter query is no sweat. What I can’t figure out is how to supply the parameter value to the query in the code below (assuming now that the second form is based on a parameter query).
‘******************* START CODE *******************
Private Sub cmdEstimates_Click()
On Error GoTo Err_cmdEstimates_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = “frmEstimatesWorkload”
stLinkCriteria = “[EstimatesWorkloadID]=” & Me![txtEstimatesWorkloadID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdEstimates_Click:
Exit Sub
Err_cmdEstimates_Click:
MsgBox Err.Description
Resume Exit_cmdEstimates_Click
End Sub
‘******************* END CODE *******************
Thanks,
Stephan