L
Leo Hamal
Hi all,
I am trying to select cmr from Customer table and pass this variable [Cust]
to a query.
When I open the form to select the customer it gets copied into the
variable. So far no problem.
When the OpenQuery executes, it asks for the parameter again.
Class module linked to my forms option button :
Private Sub Option2_Click()
Dim Cust
Set Cust = Cmr
DoCmd.OpenQuery "CustBal", acNormal, acEdit
End Sub
Custbal query :
PARAMETERS Cust Text;
SELECT TbTrans1.Tranid, TbTrans1.Cmr, TbTrans1.date, TbTrans1.Amount
FROM TbTrans1
WHERE Tbtrans1.Cmr LIKE '*' & [Cust] & '*'
ORDER BY TbTrans1.Tranid;
I tried it with and without the PARAMETERS line ==> same result.
Any ideas how this can be accomplished?
Thanks,
Leo.
I am trying to select cmr from Customer table and pass this variable [Cust]
to a query.
When I open the form to select the customer it gets copied into the
variable. So far no problem.
When the OpenQuery executes, it asks for the parameter again.
Class module linked to my forms option button :
Private Sub Option2_Click()
Dim Cust
Set Cust = Cmr
DoCmd.OpenQuery "CustBal", acNormal, acEdit
End Sub
Custbal query :
PARAMETERS Cust Text;
SELECT TbTrans1.Tranid, TbTrans1.Cmr, TbTrans1.date, TbTrans1.Amount
FROM TbTrans1
WHERE Tbtrans1.Cmr LIKE '*' & [Cust] & '*'
ORDER BY TbTrans1.Tranid;
I tried it with and without the PARAMETERS line ==> same result.
Any ideas how this can be accomplished?
Thanks,
Leo.