Search results

  1. C

    Nested Loop

    MarkK, I added the quotes and the routine is running. What a difference! Thanks very much, now I can move ahead. Much appreciated!!
  2. C

    Nested Loop

    MarkK, outer loop works well. I tested by not calling inner loop. When I call the inner loop, I get a Run-time error '3061', too few parameters, Expected 1. When I hit debug, this is the line that is highlighted in yellow by the compiler: With CurrentDb.OpenRecordset(Replace(SQL, "{0}"...
  3. C

    Nested Loop

    Static, I am close to having this run. Like to finish it, then I will take up the offer for a query.
  4. C

    Nested Loop

    MarkK, haven't abandoned this, just been tied up. This looks very interesting and I will be getting into it shortly. Thanks for your continued assistance and patience. CAMsk.
  5. C

    Nested Loop

    When I change to Do While Not .eof (both loops), the process runs thru the entire symbol list from A to Z, but nothing ever prints from the inner loop, like everything within the 'With rs2...End With' is not even there. Here is a snippet. It should be printing "inner loop" when it passes thru...
  6. C

    Nested Loop

    MarkK, great catch, sorry I forogt to explain. I put in the low values of j and k to control the loops for testing. The intent is to use EOF when the code is proven to be implementing the correct logic. I will make the change and see if this fixes the issue.
  7. C

    Nested Loop

    The_Doc_Man, I have some reading to do before I figure out how to do what you suggested. Aren't two loops required, one to advance to the next symbol, and one to cycle thru the dates? In terms of data, I have about 3,000 symbols, will keep around 210 trading days of data, and 14 fields. I expect...
  8. C

    Nested Loop

    MarkK, making progress with this module. Outer loop working as expected, symbols change in an orderly way. I made a correction in the query to "Order by MktDate", which I think you meant instead of datMarket. When I get into the inner loop, any attempt to move the pointer produces a "No current...
  9. C

    Nested Loop

    MarkK & The_Doc_Man, thanks and I now see what you were talking about. Will be revising and testing. CAMsk. I was going after this like the guy with a hammer and seeing everything as a nail.
  10. C

    Nested Loop

    One thing I might add is I created a link between the tables under Database Tools/Relationships. I have connected the primary key Symbol in tblSymbol to the foreign key Symbol in tblStockData. In this table, I also have MktDate as a primary key, so the tblStockData has a composite key. Creating...
  11. C

    Nested Loop

    MarkK, I am still getting the behavior of Symbol cycling, but can't get the MktDate to advance under my control in the inner loop. I did move rs2 to within the outer loop, and attempted to constrain the inner loop to the current symbol using the With CurrentSymbol, with no luck. When I run and...
  12. C

    Nested Loop

    MarkK thanks, I will make these changes and test. Also like the idea of making the innner loop a sub, makes a lot of sense. I'll report back.
  13. C

    Nested Loop

    Hi, I am working on an Access database for tracking stocks. The application is built on two tables. One is called tblSYMBOL with a single field SYMBOL (primary key) with a list of around 3000 stock symbols. The other table is named tblStockData with field MktDate as primary key and SYMBOL as a...
  14. C

    VBA Nested Loop controlling fields when cycling thru table

    Cronk, this changed everything, and it seems to be a breakthru. I am now working on the counters to make the loops do what I want. Thanks to you and Stopher for a big assist.
  15. C

    VBA Nested Loop controlling fields when cycling thru table

    Stopher, here are 5 rows from my database and the column names. The database is for tracking stock market data and the object is to apply screening criteria across a large selection of stocks. The last 2 columns will be computed from daily closing prices. Hope this spreadsheet shag posts ok. ID...
  16. C

    VBA Nested Loop controlling fields when cycling thru table

    Stopher, I have tried your suggestion. Added a sub name, compiles fine. Getting the Run-time error '3061': Too few parameters. Expected 1. This line highlighted; Set rs2 = dbs.OpenRecordset("SELECT * from ExportAAA where Symbol= " & rs1.Fields("Symbol"), dbOpenDynaset) I have tried single quotes...
  17. C

    VBA Nested Loop controlling fields when cycling thru table

    I am seeing that Access can do amazing things, so queries will be in the learning queue for sure. Thanks all.
  18. C

    VBA Nested Loop controlling fields when cycling thru table

    Thank you The_Doc_Man. Learning queries is on the list. Nested loop seemed like a good starting point. Appreciate the suggestions.
  19. C

    VBA Nested Loop controlling fields when cycling thru table

    Stopher, fascinating adaptation. You may have figured out how to defy gravity with your solution. I will make the suggested changes and give it a try. As requested, I will try to post data. Thanks, I would never had figured this out. :)
  20. C

    VBA Nested Loop controlling fields when cycling thru table

    MarkK, in your note about the two tables, does the field order make any difference on the suggested tblMktDate? "tblMarketDate MarketDateID (PK) SymbolID (Foreign Key - Contains the SymbolID of the related parent row) MarketDate Amount
Back
Top Bottom