Recent content by lilycao

  1. L

    Help!! 'Median' Function Problem

    I have tested your fuction. So far so good. You are so brilliant!! Thank you very much!
  2. L

    Help!! 'Median' Function Problem

    I have been gone for a few days too. Though the current solution is acceptible. I still would like to have a more perfect fuction which can be directly used in query with criteria. I used recordset.sort to reorder before recordset.movelast. But I don't know why it can't work.
  3. L

    Help!! 'Median' Function Problem

    Thank you very much!! I think It can work now. Still I have a question: is it possible to skip the first step, which is to modify the stored queries, and compile the re-order action into the function itself. Because the function may be used frequently in the database and it would be more...
  4. L

    Help!! 'Median' Function Problem

    If you don't mind, would you please look at the result of the fuction in the attached word file, which is the screen shot of the progrmme.
  5. L

    Help!! 'Median' Function Problem

    The median function code is as follows: Function Median(tName As String, fldName As String) As Single Dim MedianDB As DAO.Database Dim ssMedian As DAO.Recordset Dim RCount As Integer, i As Integer, x As Double, Y As Double, OffSet As Integer Dim qdf As QueryDef Dim prm As Parameter Set...
  6. L

    Help!! 'Median' Function Problem

    Up,Up,UP!!
  7. L

    Help!! 'Median' Function Problem

    Yes, I think that's the exact problem. The 'ssMedian' in the fuction (which is a dynaset recordset) seems to ordered according to the 'key field'. So I tried to sort this recordset according to the field that contains the value I'm trying to find the median for before the code goes to...
  8. L

    Help!! 'Median' Function Problem

    Sorry, but the code seems to have a problem. For example, if the query is named 'Test Query', I want to know the median value of its field 'rate', and the query has a criteria for field 'Date', like 'between [Forms]![Date Buffer]![BeginDate] And [Forms]![Date Buffer]![EndDate]', then if we use...
  9. L

    Help!! 'Median' Function Problem

    Thank Beetle very much!! I haven't tested throughly, but I'm too thrilled that I can't wait to reply. The problem has bothered me so long. Though I'm really a freshman in using access or SQL or VBA, I can understand the main idea of your explanation: using QueryDef in the code to re-introduce...
  10. L

    Help!! 'Median' Function Problem

    Several days no reply. Any clue that comes to your mind is welcome! Call for help!!!
  11. L

    Help!! 'Median' Function Problem

    I need to have 'median' number of required data arrays in an access database. And I found on the internet the following function which i can compile into the module and be used. The problem is that the function work well with tables and queries without criteria. However, the function can not...
Back
Top Bottom