restrict data in combo box

N

newkid

I have a combo box that lists returns. The returns can be open or
closed. I want the user to be able to restrict the data in the combo
box if they check the [ckOpen] check box. I've tried several ways but
none of them work. Any help would be appreciated.

Combo box query:
SELECT tReturns.MerchandiseReturnNo, tReturns.VendorName,
tReturns.VendorID, tReturns.Description, tReturns.ReturnDate,
tReturns.COGAccountNo, tReturns.ReturnAmount, tReturns.Status,
tReturns.CompanyID, tReturns.MerchandiseReturnNo, IIf([Forms]!
[fReturns]![ckOpen]=True,[Status]="Open","*") AS ReturnOpen
FROM tReturns
ORDER BY tReturns.VendorID, tReturns.MerchandiseReturnNo;

Thanks
 
O

omocaig via AccessMonster.com

if I am understanding the issue correctly then you need to move your iif to
the where clause:

WHERE [Status] like IIf([Forms]![fReturns]![ckOpen]=True"Open","*")

hth,
Giacomo
I have a combo box that lists returns. The returns can be open or
closed. I want the user to be able to restrict the data in the combo
box if they check the [ckOpen] check box. I've tried several ways but
none of them work. Any help would be appreciated.

Combo box query:
SELECT tReturns.MerchandiseReturnNo, tReturns.VendorName,
tReturns.VendorID, tReturns.Description, tReturns.ReturnDate,
tReturns.COGAccountNo, tReturns.ReturnAmount, tReturns.Status,
tReturns.CompanyID, tReturns.MerchandiseReturnNo, IIf([Forms]!
[fReturns]![ckOpen]=True,[Status]="Open","*") AS ReturnOpen
FROM tReturns
ORDER BY tReturns.VendorID, tReturns.MerchandiseReturnNo;

Thanks
 
N

newkid

if I am understanding the issue correctly then you need to move your iif to
the where clause:

WHERE [Status] like IIf([Forms]![fReturns]![ckOpen]=True"Open","*")

hth,
Giacomo




I have a combo box that lists returns. The returns can be open or
closed. I want the user to be able torestrictthe data in the combo
box if they check the [ckOpen] check box. I've tried several ways but
none of them work. Any help would be appreciated.
Combo box query:
SELECT tReturns.MerchandiseReturnNo, tReturns.VendorName,
tReturns.VendorID, tReturns.Description, tReturns.ReturnDate,
tReturns.COGAccountNo, tReturns.ReturnAmount, tReturns.Status,
tReturns.CompanyID, tReturns.MerchandiseReturnNo, IIf([Forms]!
[fReturns]![ckOpen]=True,[Status]="Open","*") AS ReturnOpen
FROM tReturns
ORDER BY tReturns.VendorID, tReturns.MerchandiseReturnNo;

Worked like a charm. Thanks so much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top