Search results

  1. F

    Attach a subroutine to an unbound Text box?

    I think these are the three tables I use in txt format. Hope they get through properly. Is this enough.?
  2. F

    Attach a subroutine to an unbound Text box?

    I would like to do so if you could explain what you mean. I have three tables, patients, transactions, and services. They are patients and transactions are linked one to many by a patient number. Transactions and services are also linked one to many by a service code. Would it be adequate to...
  3. F

    Attach a subroutine to an unbound Text box?

    It seems as though the expression is what Access doesn't like. If I click on any of the other fields (fee, amount, split1) the Sigma Icon in the Design tab displays all of the possible Summation values including Sum, Average, Count records, Max, Min, SD, variance. But when I highlight the...
  4. F

    Attach a subroutine to an unbound Text box?

    Didn't work. When I open the Sigma Icon in the Design Tab, all the is available to me is the "Count Records" action, all the other actions including the "Sum" action is unavailable.
  5. F

    Attach a subroutine to an unbound Text box?

    As of tonight it is working fine. Noticed that when I tried to Sum the txtbox contents that the Sum Icon in the Detail Tab is grayed out. I think I have to change the contents of the textbox to Numeric? before the Sum icon will again light. Is there a way to change the contents of the formula...
  6. F

    Attach a subroutine to an unbound Text box?

    Sorry we went out for a walk. Cooped up for weeks and the daily walk is now the law. I think I might be able to get this to work. Will try a similar statement in the second textbox control source. I will let you know if it doesn't work. I am really appreciative for all your help and...
  7. F

    Attach a subroutine to an unbound Text box?

    That worked. I really don't know how to give you a sample copy of the workspace. All I know how to do is send the complete workspace and as this is for a doctor and his patients, I am really hesitant to do it. I can try to explain the complete workspace if you want.
  8. F

    Attach a subroutine to an unbound Text box?

    If [Code1] wasn't either AL or AS I wanted a separate calculation of essentially the amount in the [Amount] field * 1 or itself If Code1 <> "AL" Or Code1 <> "AS" Then TotalA = [Amount] SplitTotal = TotalA That is why I needed the function or at least code to do the two different calculations...
  9. F

    Attach a subroutine to an unbound Text box?

    I want the function to see what is in field Code1 which is a string, and if the letters in the Code1 field are either AL or AS then calculate an amount by multiplying the field Split1(numeric) by the field Fee(numeric) to produce a total for the unbound textbox which will have a currency format...
  10. F

    Attach a subroutine to an unbound Text box?

    Do I need to place that assignment in each of the If sections or only once? I placed it in each If statement and it looks wrong. Option Compare Database Option Explicit Function SplitTotal(Code1 As String, Code2 As String) If Code1 = "AL" Or Code1 = "AS" Then TotalA =...
  11. F

    Attach a subroutine to an unbound Text box?

    Wow. Thats easy. Thanks. I do it right away.
  12. F

    Attach a subroutine to an unbound Text box?

    This is your example. I think the assignment is the Test statement. Public Function Test() As String Test = "It is now " & Now() End Function Why isn't my statement an "assignment statement". I don't understand. TotalA = [SPLIT1] * [Fee]
  13. F

    Attach a subroutine to an unbound Text box?

    I thought that as well when I wrote it. Will change it.
  14. F

    Attach a subroutine to an unbound Text box?

    This is a screen shot of the subreport section of the report. The only fields on it are the Service date, code1 and code 2, description1 and 2, and the two unbound textboxes on the right. In your addThemUp function the Val1 and val 2 are I think my two text boxes. Is that correct? Then in...
  15. F

    Attach a subroutine to an unbound Text box?

    So I rewrote the Function today and changed the arguments to Code1 and Code2. Here is the code I wrote Option Compare Database Option Explicit Function SplitTotal(Code1 As String, Code2 As String) If Code1 = "AL" Or "AS" Then TotalA = [SPLIT1] * [Fee] If Code1 <>...
  16. F

    Attach a subroutine to an unbound Text box?

    I see. Sorry I am so thick. I will rewrite the function with that in mind. Thanks again for your help.
  17. F

    Attach a subroutine to an unbound Text box?

    I wrote this in the control source box =SplitTotal() But I think I see that in the control source box I have to pass both arguments also in the parenthesis of the function, is that correct?
  18. F

    Attach a subroutine to an unbound Text box?

    Will spend some time trying to get a function properly written. Let you know if it gets done.
  19. F

    Attach a subroutine to an unbound Text box?

    Wow, that is the first time it actually worked. Put Date() into the control source and it placed the date in the field as it is supposed to do. Does that suggest that the function as written was incorrect?
  20. F

    Attach a subroutine to an unbound Text box?

    So I erased my function and just placed your Test() function into the control source. The same thing happened. When I tried to print preview the form the first thing that happens (as was happening in my function) is the a msgbox pops up and asks for the parameters of Test(). Do you have any...
Back
Top Bottom