Search results

  1. ChrisO

    Runtime Error 52 when using Dir Function

    Willknapp. There are errors in your posted code:- Post #8. strFile is passed in but you are testing for strFilename. Post #8 If Not Dir(strPath & strFilename) = "" Then Kill strPath & strFilename (You say: that specifically refers to the Dir call. But how do you know that it doesn’t refer to...
  2. ChrisO

    What does "SET" do

    Well, specifically the proof of this from post #9:- >>This is where two basic concepts come into play. First, when you open a structure, you close it. Like.... rsX.Close But then, after you close it, you need to tell Access that you are done with the data structure - so.... SET rsX = Nothing...
  3. ChrisO

    What does "SET" do

    Tony. As far as I can see, with Option Explicit turned off, all variables would be Variants and there is nothing to set any of them to Class MyStuff. Hence, I don’t think that it would be possible to get at the variable Name in Class MyStuff. Chris.
  4. ChrisO

    What does "SET" do

    Doc. Yes, post a link if you like but there is already something on this site which might help:- http://www.access-programmers.co.uk/forums/showthread.php?t=225415 There is even a demo for people to test. And on my SkyDrive site there are plenty more demos which use pointers to other Objects...
  5. ChrisO

    What does "SET" do

    Doc. Please try to prove any of that with an uploaded posted coded solution which can be substantiated by others. Chris.
  6. ChrisO

    Open Table as Read Only

    Making guesses is fine but they must be followed by testing else they remain just guesses. That is why I asked you to make your changes to the database I posted and post it back. I think if you had done that then you would have picked up the deletion problem. Yes, it is confusing, even down to...
  7. ChrisO

    Open Table as Read Only

    Well, that’s what I thought you meant but it is incorrect. Records could still be deleted so:- Me.ctlForm.Form.AllowDeletions = False would be required if the Form’s RecordsetType was in Dynaset mode. So, why don’t we just leave it up to the original poster as to which way they wish to go...
  8. ChrisO

    Open Table as Read Only

    I do not understand this point:- >>Locking the subformcontrol and changing the RecordsetType to Snapshot are two different ways of achieving very similar user experiences. Locking the control and dispalying the dynaset will reflect updates to the records. The Snapshot won't. Either way the data...
  9. ChrisO

    Open Table as Read Only

    It might be a case of ‘Hindsight is the only exact science.’ It looks wrong because people would expect a Form as the SourceObject of a subform control yet, initially, there is no Form. Nor is there a Form, used as a subform, in the database window, which is an important factor. It becomes...
  10. ChrisO

    Open Table as Read Only

    A similar thing came up on a Microsoft site very recently. The code is very small and it looks wrong, but it works. Also works for Queries. See attachment. Chris.
  11. ChrisO

    What does "SET" do

    gg. I don’t know the technical reason for Set to be required for Objects. If we omit the word Set then the compiler raises an error at runtime. So the compiler is aware of the need for the word Set at runtime but does not fix the problem at compile time. Examples: No error:- Dim X As Variant X...
  12. ChrisO

    VBA Function Creation

    Too early to say… >>However, if the search values are fixed what is the benefit of putting the data into a separate table?<< The real problem is the word if. I don’t know what these codes are but it certainly looks to me as if they may need to change over time. Performance? I don’t care about...
  13. ChrisO

    VBA Function Creation

    Yep, I was reading the InStr incorrectly. My last attempt for today:- Sub TestIt() Const DishNet As Integer = 1 Const Video As Integer = 2 Select Case IsCode("78", DishNet) + IsCode("78", Video) * Video Case 0: MsgBox "V_Only" Case 1: MsgBox...
  14. ChrisO

    VBA Function Creation

    Another approach… In Access, it is generally not appropriate to store data in code literals; Access has tables for that purpose. In this case the code literals can have a value from which to index. If the index value is a binary value then the index value can be enumerated. The enumerated...
  15. ChrisO

    Close main form with an if statement

    Clicking on the cmdClose button on the subform forces its outer most Parent Form to become the Screen.ActiveForm, so:- Private Sub cmdClose_Click() DoCmd.Close acForm, Screen.ActiveForm.Name End Sub Chris.
  16. ChrisO

    Form Layers

    Well, memory fades but we can do it with a separate popup Form. Access2003 demo attached. There are other ways to control the apparent Z order of controls on a Form two of which are the last two entries on my SkyDrive in my signature. However, both of which are more complicated. Chris.
  17. ChrisO

    Form Layers

    I don’t know what type of object you are talking about but from memory subforms stay in front. Therefore, you should be able to place the object in a subform and move it in front of the list box. Chris.
  18. ChrisO

    Use of a VBA naming convention.

    Use of a VBA naming convention. Discussion point. One of the things I have noticed over the years is that it is virtually impossible to fully describe a fault in VBA by just using the English natural language. It may be possible in natural languages other than English, I don’t know. When...
  19. ChrisO

    Nz function

    At the moment I do not think there is sufficient data to come to any firm conclusion. If we take one subform and try to return the value to its Parent:- Private Sub cmdGetTotal_Click() MsgBox IIf(IsError([29SUB].Form![Totals]), 0, Nz([29SUB].Form![Totals], 0)) End Sub Then the above...
  20. ChrisO

    Nz function

    Reb0101. The problem is not:- [29SUB].Form![TOTALS] + [33SUB].Form![TOTALS] + [41SUB].Form![TOTALS] The problem is:- [29SUB].Form![TOTALS] If any one of the three can cause the failure then it is the one which needs to be looked at, not all three at once. It is a common mistake to try and...
Back
Top Bottom