I have the following code but I am getting the following error
Invalid use of Null I am getting this error in this field SHIP_TO_ADDR_NO becuase it has no value.
OrderNo = InputBox("Please Enter/Scan Order number #:" , "Order Number")
'If OrderNo is blank.
If OrderNo = "" then
' DSN to Access file
sConnectionString = "DSN=Visual_MFG"
Set command = WScript.CreateObject("ADODB.Command")
command.ActiveConnection = sConnectionString
'Look into the Order table to find the Customer ID
command.CommandText = "SELECT CUSTOMER_ORDER.ID,CUSTOMER_ORDER.CUSTOMER_ID, CUSTOMER_ORDER.CUSTOMER_PO_REF, CUSTOMER_ORDER.SHIP_TO_ADDR_NO, CUSTOMER_ORDER.CONTACT_EMAIL FROM customer_order WHERE CUSTOMER_ORDER.ID ='" & OrderNo & "'"
Set recordset = command.Execute()
If recordset.EOF Or recordset.BOF Then
MsgBox "No records found!"
ID = Trim(recordset.fields("ID"))
CUST_ID = Trim(recordset.fields("CUSTOMER_ID"))
CUST_PO_REF = Trim(recordset.fields("CUSTOMER_PO_REF"))
SHIP_TO_ADDR_NO = Trim(recordset.fields("SHIP_TO_ADDR_NO"))
Email = Trim(recordset.fields("CONTACT_EMAIL"))
Any help would be great Thank You!
Last edited by loquin; 04-07-06 at 12:55.
Reason: add code tags. ([code] [/code])
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert