Re: Using parameters in code?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 08/26/04


Date: Wed, 25 Aug 2004 22:30:01 -0500

Shane wrote:

>how do you pass the results from one recordset to be used
>for parameters for another recordset
>
>This is what I want to do.
>
>I have a list box that shows parts on order.
>
>When i click the part I want it to find all the purchase
>orders that have that PO/Part relationship (One-many)
>using a sql statement.
>my result from that query would be example:
>PO_IDS
>426
>538
>567
>
>I want to use those Id's as parameters for another sql
>statement so I can view those purchase orders. Would this
>be an array or a loop of some sort?

Not sure I followed that. You say recordset in one place,
but later you talk about a query.

I can't be sure, but it sounds like you might be able to use
a single query:

SELECT PO_ID, . . .
FROM potable INNER JOIN partslist
                ON potable.PO_ID = partslist.PO_ID
WHERE partslist.partnnumber = FORMS!theform.thelistbox

If I've missed the boat, please post back with more details
about the tables and their fields.

-- 
Marsh
MVP [MS Access]


Relevant Pages

  • Re: Viewing the contents of two tables using ASP and MS Access
    ... Number of fields in a recordset 255 ... Number of characters in a cell in the query design grid 1,024 ... Number of characters in an SQL statement approximately 64,000 ...
    (microsoft.public.inetserver.asp.db)
  • Re: Opening a query in MS Access with parameters using VB.net
    ... datasource to a SQL statement. ... using the stored query as the datasource. ... Dim rs As Recordset ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Bounded Columns vs Recordset
    ... This involves code to get and then create the Row Source List for the ... Recordset will be based on a query, so why not just use the query ... Combobox instead of having a SQL statement in the RowSource Property. ...
    (microsoft.public.access.externaldata)
  • Re: Do While Loop code
    ... in SQL statement! ... I would just create a stored query from that SQL. ... Then you can either open a recordset on that query and retrieve the values ... outstanding transactions there are. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Do While not Statement
    ... How about just doing a count query or queries? ... intBasePaper = odoCon.ExecuteFROM tblUsers WHERE ... > the same recordset. ... > 'Initialise the strSQL variable with an SQL statement to query the ...
    (microsoft.public.inetserver.asp.general)