combobox IIF problem

  • Thread starter Thread starter Andre C
  • Start date Start date
A

Andre C

Why does the following not work in the criteria field of a querry for
a combobox
IIf([Forms]![FM_Contacts1]![Active_patient], Is Not Null,Null)

In fact everytime I enter it, it is changed to
IIf([Forms]![FM_Contacts1]![Active_patient],([admitanddischarge].[dischargedate])
Is Not Null,Null)

All I want is the content of the combobox filtered on either
dischargedate has a date or is null.
 
Hi Andre

You cannot use IIf to change the criteria for a query.

If I understand you correctly, one way to achieve this is to add an extra
column to your query:

Active: [Forms]![FM_Contacts1]![Active_patient]

Then use two criteria lines:

Active = 0 and dischargedate is Null

and

Active <> 0 and dischargedate is not Null

Of course, you will need to requery the combo box in your event procedures
for Form_Current and Active_patient_AfterUpdate.
 
On Thu, 18 May 2006 10:42:21 +1200, "Graham Mandeno"

Many thanks. I had to slightly adapt what you suggested. I had
neglected to say that Active_patient was a radio control.

I had never appreciated using the control directly in a querry as a
field. Another learning curve jump.
 

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

Back
Top