現在遇到的問題有:
打開專案查詢,裡面有以下準則
In Charge:
Is Null Or Like IIf(IsNull([forms]![專案查詢介面]![SearchInCharge]),"*",[forms]![專案查詢介面]![SearchInCharge])
PM:
Is Null Or Like IIf(IsNull([forms]![專案查詢介面]![SearchPM]),"*",[forms]![專案查詢介面]![SearchPM])
開始時間:
Is Null Or Between IIf(IsNull([FORMS]![專案查詢介面]![StartDate1]),#1911/1/1#,[FORMS]![專案查詢介面]![StartDate1]) And IIf(IsNull([FORMS]![專案查詢介面]![StartDate2]),#2030/1/1#,[FORMS]![專案查詢介面]![StartDate2])
結束時間:
Is Null Or Between IIf(IsNull([FORMS]![專案查詢介面]![EndDate1]),#1911/1/1#,[FORMS]![專案查詢介面]![EndDate1]) And IIf(IsNull([FORMS]![專案查詢介面]![EndDate2]),#2030/1/1#,[FORMS]![專案查詢介面]![EndDate2])
查詢按鈕寫一個VBA為
Private Sub ProjectSearch_Click()
Me![專案查詢子表單].Requery
End Sub
Is Null Or Like IIf(IsNull([forms]![專案查詢介面]![SearchInCharge]),"*",[forms]![專案查詢介面]![SearchInCharge]),當資料是空的,進入iif判斷時會成為什麼?iif(isnull(....),"*",............),在sql語句時select ..........from ........... where .........,在where 條件 = ...........,如是空值,則不應為修件