Search results

  1. Papa_Bear1

    Odd problem running a query from VBA

    Right - so for the date - I was merely trying to handle nulls - I didn't really care what value it took, as long as it set it to something. I probably assumed too much that adding the NZ as written made the problem go away - but it at least "seems" to work. I will double-check it more closely...
  2. Papa_Bear1

    Odd problem running a query from VBA

    Kudos to @theDBguy - as he put me on a track that seems to have resolved this mystery. After doing a little online hunting for "Debug mode behaves differently than run mode" kind of thing - I came across someone with the same kind of problem - but in Excel. Their solution was the same as...
  3. Papa_Bear1

    Odd problem running a query from VBA

    Actually, no - I had not tried that. I JUST tried that - pausing it right before where it complains, and when I step through - it works... Hmmmmm... Does that generate any new ideas?
  4. Papa_Bear1

    Odd problem running a query from VBA

    Interesting. As I've noted - (I think) the query works fine when I hit the play button after it errors... so again - I don't see how it can be a flaw with the query - when it works - just only after it complains... I will double-check this though!!
  5. Papa_Bear1

    Odd problem running a query from VBA

    I tried putting a loop in that error-catching cycle - but still no go. It seems the query won't work when "requested" to be run from VBA - but when "requested" be run by ME - (whether a pre-made query, or simply letting it continue even) - THEN it runs. I find this to be really strange...
  6. Papa_Bear1

    Odd problem running a query from VBA

    OK - but if the query is fundamentally flawed, how is it that it works fine upon hitting 'play' in VBA after clicking Debug? This is why I started the thread thinking it was NOT the query... :) I don't see how the query can be OK and not OK at the same time. It works perfectly if I simply...
  7. Papa_Bear1

    Odd problem running a query from VBA

    Right --- Well - those are not the real fieldnames - sorry 'bout that - as I said - I had to sort of mash up a sample... I think it may be too difficult to troubleshoot here without the real query. I was hoping - though - that the issue was NOT the query - since it CAN run - just by...
  8. Papa_Bear1

    Odd problem running a query from VBA

    Not to light another fuse, but I think we all know Access <> Oracle. But that is kind of the point too. I've built a lot of nice, efficient, handy tools with Access. Is it perfect? No. Does it meet every requirement? No. Is it bulletproof? Not by a longshot. But you can get a LOT done with it...
  9. Papa_Bear1

    Odd problem running a query from VBA

    Funny - I had not heard the "with a rubber mallet" add-on before... ;-) I'll try to hand-jam in something that represents the actual query --- can't really put the entire real thing in here... UPDATE tabMain AS M, tabTemp AS T SET M.Position = T.[Position], M.MoveDate = T.[Move Date]...
  10. Papa_Bear1

    Odd problem running a query from VBA

    True... The exact message was: Run-time error '3113': Cannot update '(expression)'; field not updateable. I guess that isn't all the much more informative - other than it is referring to an '(expression)' rather than a particular field name. I'm trying to put together something I can post to...
  11. Papa_Bear1

    Odd problem running a query from VBA

    True - I'll try a delay to see if that helps any...
  12. Papa_Bear1

    Odd problem running a query from VBA

    Good idea. I did try a "DoEvents" to see if maybe there were some lingering things undone, but it didn't help. Perhaps there is some other command I should run to make sure nothing is lingering?
  13. Papa_Bear1

    Odd problem running a query from VBA

    Also a very good point. Here's yet another strange set of characteristics surrounding this - related to that idea of it actually still being something wrong with the query. As you point out - I originally assumed it was a problem with the query - as we all would of course! I then modified my...
  14. Papa_Bear1

    Odd problem running a query from VBA

    Interesting idea. I will say, however, that I experimented with the usual "On Error Resume Next" before and "On Error GoTo 0" after thing and then trapped this error and told it to go back and try again. It just errorred over and over -- which is also very strange given that it normally "works"...
  15. Papa_Bear1

    Odd problem running a query from VBA

    Corrupted query - that is interesting. I would think that compact/repair would resolve something like that - which I've tried - but maybe compact/repair would not solve that. I did try the currentdb.execute also, and it behaved the same way - seems no matter HOW I try to run that query - it is...
  16. Papa_Bear1

    Odd problem running a query from VBA

    In Access 365, I often dynamically construct queries in VBA, (e.g., in a variable like "strSQL"), and then run them with DoCmd.RunSQL strSQL. I've encountered a very odd situation where Access throws Error 3113 when encountering a certain query in a VBA routine, but then upon clicking the Debug...
  17. Papa_Bear1

    How to Create an Auto-Updated "LastEdited" Field

    That’s cool, because I was indeed wondering why the system was designed to require the lookup for after-update. (...according to he documentation I found at least...) Obviously, it knows what record it’s on or we couldn’t store the key. I first tried this simply by setting the date field, and...
  18. Papa_Bear1

    How to Create an Auto-Updated "LastEdited" Field

    With the introduction of Data Macros (apparently 2010 and later), Access now supports something close to a database trigger. I was very excited to finally be able to set up a Date/Time field that would automatically update to reflect the most recent edit of any field in a table. For this to...
  19. Papa_Bear1

    Problems with Replace function...

    So - I know it is not a syntax thing - because I can get the function to work in one Access file, but not another... As far as references - it is very interesting to try to 'pull the thread' on how 'internal' functions like this - used in SQL - somehow link to references...
  20. Papa_Bear1

    Problems with Replace function...

    Very nice to know - but I think that is applicable to use of the function in VBA - right? When I try that in the SQL design view - it just opens a "Zoom" pop-up. It turns out that I've discovered that the VBA Replace function still works - so I don't know what the Replace function in SQL is...
Back
Top Bottom