Search results

  1. R

    Matrix, array, loop in VBA ?

    The mechanism you want is something like this in Excel VBA:Option Explicit Private Const kExtract As String = "Extract", kSource As String = "Source" Private wb As Workbook, s1 As Worksheet, s2 As Worksheet Private c1 As Integer, r1 As Integer, r2 As Integer Private Sub extractFields() Set wb =...
  2. R

    Special average calculation

    Something like this will do what you need:SELECT Avg(ctValue) AS AvgVolume FROM (SELECT TOP 5 ctValue FROM tCustomer WHERE ctId=2 ORDER BY ctDate DESC);The inner query selects the top 5 items for customer 2 (in this case), from the most recently dated records. The outer query takes the average...
  3. R

    IIf with multiple conditions on a calculated text box?

    Steady on! It's not that good. :) Glad to have helped - and pleased that you took it forward logically.
  4. R

    Switchboard as subform

    As promised, I have constructed an example of using a common menu as a subform to multiple forms. I originally tried to make the menu work in stand-alone mode as well as in embedded mode, but this proved more complex than I had anticipated. I got it working eventually, but I reverted to the...
  5. R

    IIf with multiple conditions on a calculated text box?

    What type of boxes are these (Combo, List, Text)? The answer will shape the way to tackle the solution. I shall assume Text boxes for now, so try this:Dim strResult As String strResult = IIf(Nz(Rate_Type, "") = "", "Empty result", IIf(Rate_Type = "hour", "'Hour' result", "'Day or Session'...
  6. R

    Question Excel file Linked to Access as tables gives Locking issues

    What mechanism do you use to link worksheets to Database tables? How many worksheets per workbook do you want to (or can) be linked? When the other user(s) open the DB, do they also have the same workbook(s) open? Any other relevant information would help.:)
  7. R

    Switchboard as subform

    Regional QLD is a big area! It's a long time since I was there, but I was mainly working in the Brisbane area. I'll put an example together for you to illustrate my techniques, which will take me a day or so. I'll address your specific points therein. I don't know about others, but the reason...
  8. R

    Need to make subform not visible until needed

    The code supplied by missinglinq is VBA. Your reply indicates you are using the Macro editor, which is not the same thing. In you command button event list, for the Click event, select [Event Procedure] from the drop-down menu. This will open the VBA code window, with the procedure block...
  9. R

    Procedures

    You can add controls to a form using the CreateControl method. The Access Help explains it reasonably well. http://msdn.microsoft.com/en-us/library/office/aa221167(v=office.11).aspx Once the form is set up, use the procedure explained by Cronk to add its module.
  10. R

    Switchboard as subform

    G'day Cobber from a Pommy :) Make a table of all possible commands for all subforms. In each row, include fields to identify the form (form name, perhaps), the specific command to be included as a number (relative to the form), the caption to be shown on that button and the required command...
  11. R

    skipping controls on validation check before update

    For a ListBox, you can check it ItemsSelected.Count value. This will be 0 if no items are selected. I haven't come across multi-value ComboBoxes? I checked the properties and didn't find MultiSelect - what is it you refer to here? Your code would be something like this:Dim ctl As Control For...
  12. R

    Form that adds data to a table depending on which option was clicked in combo box

    Here's a version which includes the buttons. I put them in the form header, but that's just a convention I use and is not important to the solution. Since my post yesterday, I thought of a way to link a new person to the supplier table when creating a new supplier. This works by showing either...
  13. R

    skipping controls on validation check before update

    What do you want to check for in the Multi-value boxes? Do you want to check that an item is selected and that it's valid; that the box has some content; the number of items selected ... there are many possibilities. Let us know which conditions are 'valid' and an answer will be provided.
  14. R

    Multiple Instance of Form, problem with Recordsource query

    Glad it worked out :) There's no substitute for thinking - especially over 4 days!
  15. R

    Search Function using multiple criteria in a form

    It's difficult to grasp what you are trying to achieve from your description :( My first thought is the use of a query on the product name column (LIKE *apple*). Do you need any one of the words to be matched, or must all of them match? I'm thinking of multiple concurrent queries for each word...
  16. R

    skipping controls on validation check before update

    In Form design mode, there is a Tag property which you can set on both form and it's controls This can be any value you want. In your ctl loop, add a check for the value of ctl.Tag (which will be null if not set). Incidentally, the With statement in your loop has no effect, so you can remove...
  17. R

    Form that adds data to a table depending on which option was clicked in combo box

    I have added two new forms to your DB; 'fSuppliersNew' and 'sfPersonNew'. This pair of forms simplifies the task you want, but it still lacks the means to add a new person when creating a new supplier. I'm struggling to understand your business model, as you appear to have a one-to-one...
  18. R

    Date Problem in Forms

    Punched cards, paper tape, 7-track magnetic tape, drum disk ... takes me back. One mainframe I worked on had 60KB (yes, KB!) memory (Core variety) and no disk. You really had to know how to use it! You'd know what 'chad patching' means, I'd guess? La Vache qui Rit (very cheesy)
  19. R

    Date Problem in Forms

    this will do the EFY date in VBA.Public Function getEFY()As Date getEFY = DateSerial(Year(Now()) - IIf(Month(Now())<4,1,0),4,1) End Functionyou can put this in a Global module or in a Form module as appropriate. Because it is a Public Function, you can use 'getEFY' in a query (using it as a...
  20. R

    Multi-Value Fields

    needs more explanation, please!
Back
Top Bottom