Filtering a recordset URGENT PLEASE
Hello. I am stuck. I do not know much about SQL and DataReports so please
explain simply if you can help.
I have a Data Report which has the following code to select all the records.
SELECT OrderReg.OrderDate AS `Order Date`, OrderReg.OrderNo AS `Order
OrderItem.OrderDetailID AS `Order Seq`, OrderItem.ProductCode AS
OrderItem.Qty AS Quantity, Product.ProductName AS `Item\r\nName`,
Product.Design AS Theme, * FROM Product, Customer, OrderItem, OrderReg
WHERE Product.ProductCode = OrderItem.ProductCode AND
Customer.CustID = OrderItem.CustID AND OrderReg.OrderNo =
Customer.CustID = OrderReg.CustID
This works. On my form I have a command button which says
Private Sub cmdPrint_Click()
Dim rsPrint As ADODB.Recordset
Dim tempnum As Integer
tempnum = Val(InputBox("Enter the Order Number You Wish to Print"))
If tempnum <> 0 Then
Set rsPrint = FilterField(DE1.rsrsAll4Print, "OrderReg.OrderNo", (tempnum))
DataReport1.DataMember = rsPrint <<<<<<<<<<<<<<
MsgBox ("NO order number entered")
When I run this I get an error message "Type Mismatch" on the line marked
I need to run this report on one order number only, at each time. See
tempnum above. If there is a better or easier way, please, please show me. I
need to have this finisshed by tomorrow.