Recordset filter

Results 1 to 2 of 2

Thread: Recordset filter

  1. #1
    Join Date
    Dec 1969

    Default Recordset filter

    I&#039;m joining two tables and the I want to do a recordset filter. It doesn&#039;t work!! Can anybody tell me what should I do?<BR>My tables are "ea" and "la".<BR>Is this wrong? - <BR>objRs.Filter = " ea.Agent_Type = 0"<BR><BR>I think I&#039;m doing everything alright unless it&#039;s impossible to do a RS.Filter when joining tables!!!<BR>Any help would be very much appreciated.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Table names are *not* retained... the RecordSet fields.<BR><BR>You can&#039;t refer to a field via RS("ea.Agent_Type"), so you can&#039;t use such a field name in the filter. You either need to do<BR>&nbsp; &nbsp; objRS.Filter = "Agent_Type = 0" <BR>or, if you have an Agent_Type in each table, construct your query in such a way as to give each a unique name in the recordset:<BR><BR>SELECT ea.Agent_Type AS eaAgent, la.Agent_Type AS laAgent, ... FROM ea, la ...<BR><BR>So that now you can safely use<BR>&nbsp; &nbsp; objRS.Filter = "eaAgent = 0" <BR><BR>

Posting Permissions

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