Module not generating results into table 
Author Message
 Module not generating results into table

Hi,

Have a module designed to open tables and get
info based on certain fields within the table.
Module has the variables defined ok and runs ok,
even opens a temp table to put info into.
But no info is being placed in the table.
Just need someone to gives me a quick guide on wether the variables are
correctly setup.

This is what I have come up with so far, not sure
where to place the variables within each case.

######Code######
Function ImportUpdate()
Dim MyRecord As RecordSet, PayDate As Date, Comp As String, DonorN As
String, DonorInit As String,
 EmpId As Integer, Charity As String, GST As Integer, Amt As Currency,
AmtRet As Currency,
 GPool As Currency, CalcAmt As Currency, MemShare As Currency, NonMemShare
As Currency
Dim dbs
Dim InputData

Open "C:\Access\ESA\DC CAF-ESA.txt" for Input As #1     'open file for input
Do While Not EOF(1)    ' Check for end of file
    Line Input #1, InputData

    Select Case ((InputData)
        Case (1)
            If dbs![DC CAF-ESA].[CHARITY NAME] = ("ESA" And
dbs![OrganContactDetails].[WhoseClient] = "ESA")
            PayDate = dbs![DC CAF-ESA].[Payroll Date]
            Comp = dbs![DC CAF-ESA].[Company Name]
            DonorN = dbs![DC CAF-ESA].[Employee Surname]
            DonorInit = dbs![DC CAF-ESA].[Initials]
            EmpId = dbs![DC CAF-ESA].[EmployeeID]
            Amt = dbs![DC CAF-ESA].[Donation Amount]
            Charity = dbs![DC CAF-ESA].[CHARITY NAME]
            CalcAmt = (Amt - (15 / 100))               ' 15% Management Fee
            GPool = (CalcAmt / 2)                         ' Split amount
into two pools
            MemShare = (GPool / 11)                    ' Divide result by
count of Members
            GST = (MemShare / (10 / 100))           ' Apply GST of 10%
            Enf If

        Case (2)
            Table.[DC CAF-ESA].[CHARITY NAME] = ([Groupnames].[GroupName]
And Table.[Groupnames].[Member?] = "Yes") And
[OrganContactDetails].[WhoseClient] = "ESA"
            PayDate = [DC CAF-ESA].[Payroll Date]
            Comp = [DC CAF-ESA].[Company Name]
            DonorN = [DC CAF-ESA].[Employee Surname]
            DonorInit = [DC CAF-ESA].[Initials]
            EmpId = [DC CAF-ESA].[EmployeeID]
            Amt = [DC CAF-ESA].[Donation Amount]
            Charity = [DC CAF-ESA].[CHARITY NAME]
            CalcAmt = (Amt - (15 / 100))
            MemShare = (Amt - CalcAmt)
        Case (3)
            Table.[DC CAF-ESA].[CHARITY NAME] = ([Groupnames].[GroupName]
And Table.[Groupnames].[Member?] = "No")
            PayDate = [DC CAF-ESA].[Payroll Date]
            Comp = [DC CAF-ESA].[Company Name]
            DonorN = [DC CAF-ESA].[Employee Surname]
            DonorInit = [DC CAF-ESA].[Initials]
            EmpId = [DC CAF-ESA].[EmployeeID]
            Amt = [DC CAF-ESA].[Donation Amount]
            Charity = [DC CAF-ESA].[CHARITY NAME]
            CalcAmt = (Amt - (5.5 / 100))
            NonMemShare = (Amt - CalcAmt)
        Case (4)
            Table.[DC CAF-ESA].[CHARITY NAME] = ([Groupnames].[GroupName]
And Table.[Groupnames].[Member?] = "Yes") And
[OrganContactDetails].[WhoseClient] <> "ESA" And
Table.[OrganisationUpdates].[InitialProgramDate] < (Date - 1096)
            PayDate = [DC CAF-ESA].[Payroll Date]
            Comp = [DC CAF-ESA].[Company Name]
            DonorN = [DC CAF-ESA].[Employee Surname]
            DonorInit = [DC CAF-ESA].[Initials]
            EmpId = [DC CAF-ESA].[EmployeeID]
            Amt = [DC CAF-ESA].[Donation Amount]
            Charity = [DC CAF-ESA].[CHARITY NAME]
            CalcAmt = (Amt - (15 / 100))
            AmtRet = (CalcAmt / (30 / 100))
            GPool = (AmtRet / 2)
            MemShare = (GPool / 11)
            GST = (MemShare / (10 / 100))
             Else
                PayDate = [DC CAF-ESA].[Payroll Date]
                Comp = [DC CAF-ESA].[Company Name]
                DonorN = [DC CAF-ESA].[Employee Surname]
                DonorInit = [DC CAF-ESA].[Initials]
                EmpId = [DC CAF-ESA].[EmployeeID]
                Amt = [DC CAF-ESA].[Donation Amount]
                Charity = [DC CAF-ESA].[CHARITY NAME]
                CalcAmt = (Amt - (15 / 100))
                GPool = (CalcAmt / 2)
                MemShare = (GPool / 11)
                GST = (MemShare / (10 / 100))
        Case (5)
            Table.[DC CAF-ESA].[CHARITY NAME] = ([Groupnames].[GroupName]
And Table.[Groupnames].[Member?] = "Yes") And
([OrganContactDetails].[WhoseClient] <> [Groupnames].[GroupName])
            PayDate = [DC CAF-ESA].[Payroll Date]
            Comp = [DC CAF-ESA].[Company Name]
            DonorN = [DC CAF-ESA].[Employee Surname]
            DonorInit = [DC CAF-ESA].[Initials]
            EmpId = [DC CAF-ESA].[EmployeeID]
            Amt = [DC CAF-ESA].[Donation Amount]
            Charity = [DC CAF-ESA].[CHARITY NAME]
            CalcAmt = (Amt - (15 / 100))
            MemShare = (Amt - CalcAmt)
        Case (6)
            Table.[DC CAF-ESA].[CHARITY NAME] = ([Groupnames].[GroupName]
And Table.[Groupnames].[Member?] = "No") And
([OrganContactDetails].[WhoseClient] <> [Groupnames].[GroupName])
            PayDate = [DC CAF-ESA].[Payroll Date]
            Comp = [DC CAF-ESA].[Company Name]
            DonorN = [DC CAF-ESA].[Employee Surname]
            DonorInit = [DC CAF-ESA].[Initials]
            EmpId = [DC CAF-ESA].[EmployeeID]
            Amt = [DC CAF-ESA].[Donation Amount]
            Charity = [DC CAF-ESA].[CHARITY NAME]
            CalcAmt = (Amt - (5.5 / 100))
            NonMemShare = (Amt - CalcAmt)
    End Select
    Open "DCCAFTEMP" For Append As #1    'Not sure on this.
    Write #1, Paydate,    'Not sure on this.
    Write #1, Comp,    'Not sure on this.
    Write #1, DonorN,    'Not sure on this.
    Write #1, DonorInit,    'Not sure on this.
    Write #1, EmpId,    'Not sure on this.
    Write #1, Amt,    'Not sure on this.
    Write #1, Charity,    'Not sure on this.
    Write #1, CalcAmt,    'Not sure on this.
    Write #1, GPool,    'Not sure on this.
    Write #1, MemShare,    'Not sure on this.
    Write #1, NonMemShare,    'Not sure on this.
    Write #1, GST;    'Not sure on this.

    Loop         'loop back till all records have been read.
    Close #1       'close file till next append.

End Function
####################################
This last part is mainly where I need help, placing the variables and
getting the data into a table.

Any help really would be appreciated.



Tue, 12 Oct 2004 20:43:10 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. generating a table of results from a VBA function

2. ImportErrors Table Not Generated

3. Standard module not visible through tables

4. Tracing relationships and generating tables in VBA (Generating Word tables whose structure is not known in advance)

5. VB4 linking tables results in read-only table definition

6. Problem in generating Crystal Report with temporary tables(#table) in SP

7. Results generated in 2 output csv files are different in 2 locatio

8. Referece a module and have it not run the module

9. UserForm code module not visible from normal module

10. putting a result of a module in a message box

11. Modules: setting a variable in memory to the results of a query (EXCEL AUTOMATION)

12. Returning Query results to a module

 

 
Powered by phpBB® Forum Software