Search results

  1. D

    Using VBA to search all tables in a database

    It looks like you need to assign the following line to a variable, or call it like a Sub SearchTable(sTable, SearchString) Try changing it to: SearchTable sTable, SearchString You are also missing a parenthesis on the MsgBox line.
  2. D

    VBA SQL CREATE TABLE with String for table name

    Totally agree, no spaces is the best option. The table I most had issues with in the past had an '&' in its name.
  3. D

    Using VBA to search all tables in a database

    If you know the name of the column in the table, and it is a text field you can use something like the following: Public Function FindTextValueAllTables(ByVal ColumnName As String, ByVal txtSearch As String) As String On Error GoTo Errorhandler Dim td As DAO.TableDef Dim db As DAO.Database...
  4. D

    VBA SQL CREATE TABLE with String for table name

    Use: StrTablename = "Autopay Accounts" Currentdb.Execute "CREATE TABLE [" & StrTablename & "] (RecordStatus varchar(2))" or as pbaldy says, remove the space from the name
  5. D

    Access Error 2110

    You will need to either: Set the frm.cmdClose.Visible and /or frm.cmdClose.Enabled to True before setting focus Test whether it is Visible and Enabled and do not set focus of either is false Add a test in your error handler for 2110 and use Resume Next to ignore the problem. In general you...
  6. D

    Closing Database Objects: Explicitly Required?

    Agreed, this is from the OP. I included it with >> << to try to avoid attributing the first part to Chris but without it his response which is what I was trying to quote would have no context. This was certainly not an attempt by me to misquote Chris. Sorry if this was not sufficiently clear.
  7. D

    Closing Database Objects: Explicitly Required?

    Hi RainLover, Sorry, but I am finding it difficult to follow what you are saying. Rather than me guess and risk misquoting someone again, can you please clarify what you meant by : "That is not Chris's quote." or reword your question / point?
  8. D

    Closing Database Objects: Explicitly Required?

    Hi RainLover, You are correct that Chris did not say never, it was more implicit than explicit in his reply. This comment was cut and pasted from post number 3 which was posted by Chris. I am not sure why you say that he didn't say this but if that is the case there is also post 26 where...
  9. D

    Closing Database Objects: Explicitly Required?

    @ rainlover: The post was in #3 (his first so not that hard to find) where he said: >>I see lots of preaching online about the importance of Closing these objects or setting them to Nothing so as to free up resources, but these Help statements seem to say it's unnecessary.<< All it is is...
  10. D

    Closing Database Objects: Explicitly Required?

    Thanks Rainlover, I did look at the example that you posted but as I have said in the past - there is a big difference between does not happen and can not happen. If you want to prove something, it taked infinately more evidence than to disprove something which takes only one example. In the...
  11. D

    Closing Database Objects: Explicitly Required?

    Thanks RainLover, but this has moved on from the original question as ChrisO has brought in the advice that you never need to set a value to Nothing and never need to close a Recordset. If he is okay with retracting this advice then the thread is closed but I somehow doubt that this is the case...
  12. D

    Closing Database Objects: Explicitly Required?

    Yes, I can explain it. The purpose of my test is to show what happens when you try to dispose a class that the GC can't handle (either a self reference or a cyclical reference in this case). Your example contains a Long type which is held internally on the stack rather than an object which is...
  13. D

    Closing Database Objects: Explicitly Required?

    Okay, I think this may also cover point 3 but if not we can cover it later. I think I already saw where you are going with this but I should not have presumed so: Chris, why did you introduce Private Sub Class_Initialize() and Private Sub Class_Terminate() into the discussion?
  14. D

    Closing Database Objects: Explicitly Required?

    Okay, I appologize for the misquote - but since neither the Class_Initialize, not the Class_Terminate were part of my sample code, and that Class_Initialize would have been called in my sample code had it existed, can we proceed? I am happy to talk about point 3, or move to point 4 if you prefer?
  15. D

    Closing Database Objects: Explicitly Required?

    Hi ChrisO, I am hoping that this is the new "more constructive and possitive" version of this thread. Did you want to proceed to point 2 ?: >>Dim c1 As New Class1<< >>is not the same as:-<< >>Dim c1 As Class1<< >>Set c1 = New Class1<< >>If the Private Sub Class_Initialize() is not called...
  16. D

    Closing Database Objects: Explicitly Required?

    Okay, yes - I realised that they were quoting VB, not VBA but the definitions are correct for both in what they do. I noticed that the default was wrong for VBA so I corrected the option explicit post to avoid causing any confusion. MSDN does not cover VBA very well and I did not want to quote...
  17. D

    Closing Database Objects: Explicitly Required?

    Hi Chris, I am trying to help you by proving the need to close database objects but you keep going off on tangents and questioning irrelevant issues like option explicit. You are correct that in MS Access option explicit is off by default but my point is that sample code and production code...
  18. D

    Closing Database Objects: Explicitly Required?

    Okay, we can take each one individually if you like. Point 1: >>Option Explicit was not turned on behind the Form<< >>That does not stand in good stead of an experienced programmer.<< I consider this irrelevant because it is not needed and has no impact on this test since I do declare all of...
  19. D

    Closing Database Objects: Explicitly Required?

    @Speakers_86 From your previous post about timing - did you realize that all recursive programming can be converted to non-recursive? I have not seen your code but please feel free to ask any questions about improving performance either publically or privately if performance is a problem for you.
  20. D

    Closing Database Objects: Explicitly Required?

    I find one things slightly strange. ChrisO is the only person on this site that I have thanked to date for useful advice. Developers are typically more interested in helping each other than trying to convert them to their own style of coding so this may well be the only issue that we disagree...
Back
Top Bottom