Results 1 to 2 of 2

Thread: RECORDSET,open where multiple clauses

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jan 2017
    Posts
    1

    RECORDSET,open where multiple clauses

    HI

    I am having issue with recordset when my where clause has more than 1 field
    'objRecordSet.Open "SELECT SalesOrder,SalesOrderLine FROM tbl_SorDetail_OtifAudit WHERE SalesOrder = '" & OrderHeader.CodeObject.SalesOrder &"'"
    this works correctly
    but I don't know correct way to add where SalesOrderLine = & OrderHeader.CodeObject.OrderLine &
    I have tried numerous ways and all return recordcount = 0 when know that is not correct

    any help much appreciated
    Tina

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: RECORDSET,open where multiple clauses

    Nothing special about it at all... it's just an additional AND in the where
    Code:
    "SELECT SalesOrder,SalesOrderLine FROM tbl_SorDetail_OtifAudit WHERE SalesOrder = '" & OrderHeader.CodeObject.SalesOrder & "' AND SalesOrderLine = "' & OrderHeader.CodeObject.OrderLine & "'"
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width