Trouble with IIF

Ethereal

Warcraft III Player
Local time
Today, 06:25
Joined
Jan 17, 2006
Messages
99
This is the SQL statement that represents the rowsource for one of my combo boxes... I have 5 combo boxes in a sort of search form where the rowsource of each box is dependant on the value of another box, For example If i choose a sample ID there should only be one value for each of the other boxes since that one sample has unique properties, where as if i select "polished sample" then the sample ID list should be reduced in size... Anyway... here is the SQL for my Sample Number cbo box

SELECT tSample.SamID FROM tSampleCustomer INNER JOIN tSample ON tSampleCustomer.SamID = tSample.SamID WHERE (((tSampleCustomer.CustName) Like IIf(IsNull([Forms]![fSampleSearch]![cboCustomerName]),"*",[Forms]![fSampleSearch]![cboCustomerName])) AND ((tSample.SamTypeID) Like IIf(IsNull([Forms]![fSampleSearch]![cboSampleType]),"*",[Forms]![fSampleSearch]![cboSampleType])) AND ((tSample.SamThick) Like IIf(IsNull([Forms]![fSampleSearch]![cboSampleThickness]),"*",[Forms]![fSampleSearch]![cboSampleThickness])) AND ((tSampleCustomer.ProjectName) Like IIf(IsNull([Forms]![fSampleSearch]![cboProjectName]),"*",[Forms]![fSampleSearch]![cboProjectName]))) GROUP BY tSample.SamID ORDER BY tSample.SamID;

Can anybody help me ... ?
 

Users who are viewing this thread

Back
Top Bottom