Search results

  1. 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...
  2. 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.
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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.
  8. 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.
  9. 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.
  10. 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...
  11. 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...
  12. 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...
  13. ChrisO

    Subform control event

    If you want to automatically set up the handlers in the Main Form and all subforms then you can place the following in the Main Form’s Load event directly in the Property sheet:- =SetHandlers([Form]) For this to work, the Main Form and subforms do not need their Class Module to exist. Of...
  14. ChrisO

    Exceptions List

    You could put a flag in the control's Tag property to include that control. Chris.
  15. ChrisO

    Subform control event

    Interestingly peculiar: the List Box seems to need to be passed as an Object not as a Control… Behind a Form or Subform:- Private Sub List0_AfterUpdate() ClearListBoxes Exception:=Me.List0 End Sub (We can push it to the Property Sheet if required but that doesn’t matter at this...
  16. ChrisO

    New to VBA any suggestions

    Bart. As usual I will take a different tack. 1. Learn how to create a standard module. 2. Permanently turn on Option Explicit. 3. Learn how to save that module. 4. Start typing. 5. The F1 key is your friend. 6. If, after using the F1 help topics, you still get an error which you don’t...
  17. ChrisO

    Gun laws do they work

    Col. For the very reasons you have given, that regulation has been changed but I don’t know which year it was changed. (I think at least 35 years ago.) Since you lived at Maroubra for a while you may be referring to Anzac Parade which was a particularly bad example of where that regulation was...
  18. ChrisO

    Simple way to give all Null values 0 in calculated fields..?

    Okay, good question. Since I introduced the word into this thread I’ll give it a shot. I post #25, Galaxiom users the line of code ‘Nz = Empty’ in the else clause to explicitly set the value of his Nz function to Empty. It was done for educational purposes to explicitly show what is happening...
  19. ChrisO

    Simple way to give all Null values 0 in calculated fields..?

    Thank you Galaxiom. Galaxiom has presented a correct and an explicit representation of the Nz() function. It leads us to the outcome that the Nz() function returns Empty. Now I will go down the path of the implicit outcome:- Sub TestIt_1() Dim X As Variant Select Case IsEmpty(X)...
  20. ChrisO

    Gun laws do they work

    Col. A lot of years ago, prior to me getting my drivers licence in NSW, I spent two years, almost on a daily basis at work, reading a document which was available for free from the NSW motor registry offices. It was the official document, as also used by the Police department, and contained two...
Back
Top Bottom