MacroAlan
New Member
- Joined
- Aug 30, 2004
- Messages
- 31
I have all the myriad parameters for some canned queries in a lookup table. In some of the instances, the Branch must be specified and others it is blank. In some instances I am looking whether the Customer exists or not.
What is the correct syntax to check for NULL in Case?
Code:
Set DB = CurrentDb()
Set McP = DB.OpenRecordset("tbl_APAP_Param")
Do While Not McP.EOF
McP.MoveFirst
Select Case McP!Branch
Case McP!Branch = Null 'ERROR here
Select Case McP!CustomerList
Case False
'Not Customer amd Not Branch Specific
BuildProg "Performing " & McP!Category & " for " & McP!Order_Type
SQLstr = "UPDATE tbl_Sales_Data_APAP LEFT JOIN tbl__Customer_Names ON tbl_Sales_Data_APAP.[Sold to Num] = "
SQLstr = SQLstr & " tbl__Customer_Names.[SoldToCustNbr] SET tbl_Sales_Data_APAP.[Customer]= '" & McP!Category & "'"
SQLstr = SQLstr & " WHERE (((tbl_Sales_Data_APAP.[Order Type])='" & McP!Order_Type & "') AND ((tbl__Customer_Names.SoldToCustNbr) Is Null));"
Case True