I have the following 3 access objects
frmSignOff , rptSignOff, and qrySignOff.
The form frmSignOff has 2 unbound text boxes and 1 unbound combo box that the user enters search criteria in to populate the query qrySignOff.
I want to force the user to enter a control number in the text box txtCtrl. I thought I could accomplish this by putting this line in the query:
IIf(IsNull([Forms]![frmSignOff]![txtCtrl]),[Please Enter A Control Number],[Forms]![frmSignOff]![txtCtrl])
Here is the complete SQL statement:
What happens when the report rptSignOff is run and the query executes, a parameter dialog box comes up telling the user ” Please Enter A Control Number ” even if the user enters a value into the unbound text box (txtCtrl) . In other words it fires whether there is a value in the text box or not.
Obviously there is something wrong with this line:
IIf(IsNull([Forms]![frmSignOff]![txtCtrl]),[Please Enter A Control Number],[Forms]![frmSignOff]![txtCtrl])
Can somebody offer some help ?
Thanks in advance.
frmSignOff , rptSignOff, and qrySignOff.
The form frmSignOff has 2 unbound text boxes and 1 unbound combo box that the user enters search criteria in to populate the query qrySignOff.
I want to force the user to enter a control number in the text box txtCtrl. I thought I could accomplish this by putting this line in the query:
IIf(IsNull([Forms]![frmSignOff]![txtCtrl]),[Please Enter A Control Number],[Forms]![frmSignOff]![txtCtrl])
Here is the complete SQL statement:
Code:
SELECT tblEmployees.FirstName, tblEmployees.LastName, tblEmployees.Dept, tblEmployees.Unit, tblEmployees.Active, tblMemos.CtrlNo, tblMemos.Re
FROM tblEmployees, tblMemos
WHERE (((tblEmployees.Dept)=IIf(IsNull([Forms]![frmSignOff]![cboDept1]),[tblEmployees].[Dept],[Forms]![frmSignOff]![cboDept1])) AND ((tblEmployees.Unit)=IIf(IsNull([Forms]![frmSignOff]![txtLoc]),[tblEmployees].[Unit],[Forms]![frmSignOff]![txtLoc])) AND ((tblEmployees.Active)="yes") AND ((tblMemos.CtrlNo)=IIf(IsNull([Forms]![frmSignOff]![txtCtrl]),[Please Enter Control Number],[Forms]![frmSignOff]![txtCtrl])));
What happens when the report rptSignOff is run and the query executes, a parameter dialog box comes up telling the user ” Please Enter A Control Number ” even if the user enters a value into the unbound text box (txtCtrl) . In other words it fires whether there is a value in the text box or not.
Obviously there is something wrong with this line:
IIf(IsNull([Forms]![frmSignOff]![txtCtrl]),[Please Enter A Control Number],[Forms]![frmSignOff]![txtCtrl])
Can somebody offer some help ?
Thanks in advance.