Invoice Calculations, FindRecord Command, please help!

  • Thread starter Thread starter RichN
  • Start date Start date
R

RichN

Ok, here's the code:

Private Sub Calculator_Click()

'Declare variables to be called by this sub to populate
the values calculated on the function.

Dim CalcTotal As Currency
Dim CalcSigning As Currency
Dim CalcConc As Currency
Dim CalcEdocs As Currency
Dim CalcDocPrint As Currency
'Set all appropriate values to 0

CalcTotal = 0
CalcSigning = 0
CalcConc = 0
CalcEdocs = 0
CalcDocPrint = 0

'Call the function, passing the correct parameters
Call Invoice_Calculator(Me![Signing_Fee], Me!
[Concurrent_Fee], Me![Edocs_Fee], Me![Doc_Print_Fee], Me!
[Total_Fee], Me![Signing Status], Me![Partial_Signing], Me!
[Edocs_Checkbox], Me![Doc_Printing_Chkbox], Me!
[Invoice_Credit], Me![NoChargeCheck], Me![Other_Fee], Me!
[Other_Fee_Comments], [Forms]![S-Signing Summary]!
[Client_Single_Page_Fee], [Forms]![S-Signing Summary]!
[Client_Fee_No_Sign], [Forms]![S-Signing Summary]!
[Client_Fee_Edocs], [Forms]![S-Signing Summary]!
[Client_Doc_Print_Fee], [Forms]![S-Signing Summary]!
[Client_Fee_Standard], [Forms]![S-Signing Summary]!
[Client_Concurrent_Fee], [Forms]![S-Signing Summary]!
[No_Show_Biller], CalcTotal, CalcSigning, CalcConc,
CalcEdocs, CalcDocPrint)

'Set returned values into the appropriate fields
Me![Total_Fee] = CalcTotal
Me![Signing_Fee] = CalcSigning
Me![Concurrent_Fee] = CalcConc
Me![Edocs_Fee] = CalcEdocs
Me![Doc_Print_Fee] = CalcDocPrint
'End the sub

End Sub

My apologies for including all the parameter passing, but
I am at point break and am not sure what I need to do.
This sub calls a function that performs calculations for
an invoice report. The report is then sent to an e-mail
and onto the client. What I need to do, and cannot do, is
have multiple appointments, which qualify for billing,
populated on the same report. This works fine if I dump
everything, but I want only the qualified appointments to
be included. The field that determines whether an
appointment is qualified is located on a subform and is
called [Signing Status]. As you can see from the function
call, the button that activates the function is located on
the subform itself. I want to, using the FindRecord
command, I think, search through all the signing status
fields in the recordset for 3 different signing
types, "3", "4" and "5". Then, using those values,
perform the appropriate calculations in the called public
function. I have not been able to get this to work, and
am running out of time. Any help given would be
appreciated greatly. Thank you.
 
RichN, you are going about this problem the wrong way.

From a quick read, I would say that it is not much to do with your code, or
the design of your forms or reports. It is to do with your >database
structure<, that is, what tables you have, and what are their
characteristics - in particular, what are their primary keys. The question
really is, "Given the following table structure, how do I extract the
records for ... (whatever)".

I suggest that you tell us your table structure, using the following example
format, & then restate your question in the terms suggested above.

tblPerson - one row for each person known to the system.
PersonID (autonumber) (Primary Key)
forname (text)
surname (text)
etc.

HTH,
TC


RichN said:
Ok, here's the code:

Private Sub Calculator_Click()

'Declare variables to be called by this sub to populate
the values calculated on the function.

Dim CalcTotal As Currency
Dim CalcSigning As Currency
Dim CalcConc As Currency
Dim CalcEdocs As Currency
Dim CalcDocPrint As Currency
'Set all appropriate values to 0

CalcTotal = 0
CalcSigning = 0
CalcConc = 0
CalcEdocs = 0
CalcDocPrint = 0

'Call the function, passing the correct parameters
Call Invoice_Calculator(Me![Signing_Fee], Me!
[Concurrent_Fee], Me![Edocs_Fee], Me![Doc_Print_Fee], Me!
[Total_Fee], Me![Signing Status], Me![Partial_Signing], Me!
[Edocs_Checkbox], Me![Doc_Printing_Chkbox], Me!
[Invoice_Credit], Me![NoChargeCheck], Me![Other_Fee], Me!
[Other_Fee_Comments], [Forms]![S-Signing Summary]!
[Client_Single_Page_Fee], [Forms]![S-Signing Summary]!
[Client_Fee_No_Sign], [Forms]![S-Signing Summary]!
[Client_Fee_Edocs], [Forms]![S-Signing Summary]!
[Client_Doc_Print_Fee], [Forms]![S-Signing Summary]!
[Client_Fee_Standard], [Forms]![S-Signing Summary]!
[Client_Concurrent_Fee], [Forms]![S-Signing Summary]!
[No_Show_Biller], CalcTotal, CalcSigning, CalcConc,
CalcEdocs, CalcDocPrint)

'Set returned values into the appropriate fields
Me![Total_Fee] = CalcTotal
Me![Signing_Fee] = CalcSigning
Me![Concurrent_Fee] = CalcConc
Me![Edocs_Fee] = CalcEdocs
Me![Doc_Print_Fee] = CalcDocPrint
'End the sub

End Sub

My apologies for including all the parameter passing, but
I am at point break and am not sure what I need to do.
This sub calls a function that performs calculations for
an invoice report. The report is then sent to an e-mail
and onto the client. What I need to do, and cannot do, is
have multiple appointments, which qualify for billing,
populated on the same report. This works fine if I dump
everything, but I want only the qualified appointments to
be included. The field that determines whether an
appointment is qualified is located on a subform and is
called [Signing Status]. As you can see from the function
call, the button that activates the function is located on
the subform itself. I want to, using the FindRecord
command, I think, search through all the signing status
fields in the recordset for 3 different signing
types, "3", "4" and "5". Then, using those values,
perform the appropriate calculations in the called public
function. I have not been able to get this to work, and
am running out of time. Any help given would be
appreciated greatly. Thank you.
 
Back
Top