Recent content by GrahamMandeno

  1. G

    Changing backend from a button

    Hi Jason I can see a few problems in your code, but not one that would give you "Argument not optional". The first is that you have a duplicate declaration for strNewPath. In the procedure declation you have an argument strNewPath As String. Then, further down you have: Dim strNewPath...
  2. G

    Creating AuditTrail - how to handle empty values

    Hi Karen I'm glad you've got it working :) Further to The_Doc_Man's comments, there are a couple of ways to prevent this kind of error creeping into your code: First, you can check the type of control using the ControlType property - for example: If ctl.ControlType = acTextBox Then...
  3. G

    On Error GoTo not working

    Hi ML In the VB editor window, go to Tools > Options > General tab. Make sure you don't have "Break on all errors" selcted in the "Error trapping" section. -- Graham
  4. G

    Creating AuditTrail - how to handle empty values

    Hi kfschaefer I'm not sure what you are intending here: If Nz(ctl.oldvalue, "empty") = True Then Exit Sub Do you want to exit your sub if ctl.OldValue is null? If so, try this: If IsNull(ctl.oldvalue) Then Exit Sub However, I don't think this is really your intention. Say you have five...
  5. G

    Enable Button if all questions are answered

    I'm glad it's working well for you :) Both the public functions (AppendArray and CheckRequiredFields) should be pasted into a standard module, not a form module. Then they can be called from your form modules. The file size must have increased for some other reason. Do a compact/repair...
  6. G

    Enable Button if all questions are answered

    As someone once said, "necessity is the mother of invention" :) Here is a function to append values to an array: Public Function AppendArray( _ AddTo As Variant, _ ParamArray NewVals() As Variant _ ) As Variant Dim a As Variant, i As Integer, iFirstNew As Integer If IsArray(AddTo)...
  7. G

    Enable Button if all questions are answered

    Hello again The problem is that the list of required fields varies according to the answers that were given. I suggest you declare a variable for the "required" list and set that variable accordingly, then pass it to the CheckRequiredFields function: Dim aRequired as Variant If Me.q4 = 0...
  8. G

    Report Text Box

    Hi Andy Yes, you can change the size and position of a textbox in the Format event procedure for the section that contain it. For example, this will centre the textbox between the left and right margins: txtMemo.Left = (Me.Width - txtMemo.Width) / 2 The only caveat is that you cannot...
  9. G

    Enable Button if all questions are answered

    That's great! I'm glad you got it working. Thanks for offering to credit. Just my sig below will be fine :-) -- Graham Mandeno [Access MVP - Auckland, New Zealand]
  10. G

    Enable Button if all questions are answered

    That's almost correct, except that the name of the form must be in quotes (otherwise it will be interpreted as the name of a variable) and also, I assume you will want to close the current form when you open the new one. Oh, and I see you want the form opened in data entry mode... Private...
  11. G

    Enable Button if all questions are answered

    Hello vzx I don't think it's necessary to disable the "Next" button. Instead, why not check that the required values are supplied when the button is clicked and proceed only if everything is OK? Since you want to perform this kind of check for several forms, it makes sense to use a...
Back
Top Bottom