Filtering a recordset URGENT PLEASE 
Author Message
 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
Number`,
    OrderItem.OrderDetailID AS `Order Seq`, OrderItem.ProductCode AS
`Product Code`,
    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 =
OrderItem.OrderNo AND
    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  <<<<<<<<<<<<<<
DataReport1.Refresh
DataReport1.Show
Else
MsgBox ("NO order number entered")
End If
End Sub

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.

Thanks
Chris



Mon, 13 Oct 2003 03:15:40 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. URGENT: Ado Recordset + Filter / MoveNext/Bookmark

2. URGENT: Ado Recordset + Filter / MoveNext/Bookmark

3. Help Please: Select recordset... (URGENT)

4. URGENT please help : ODBCDirect (Vb5) : I cannot create Multiple recordset

5. FILTERING RECORDSET BASED ON ANOTHER RECORDSET

6. Filtering Single recordset vs creating multiple recordsets

7. get a new recordset based on a filtered recordset

8. Xtract a recordset from an existing recordset w/out using Filter

9. URGENT HELP PLEASE PLEASE PLEASE???

10. urgent please i beg please i beg please i beg

11. Urgent: Trying to Filter Records in Report

12. Urgent: Trying To Filter Records in Report

 

 
Powered by phpBB® Forum Software