[AccessD] Why is function being called??

Bobby Heid bheid at appdevgrp.com
Wed Aug 17 08:02:53 CDT 2005


I figured so, I was just making sure.

So you are saying that DaysInMonth2 is being called when you execute the
line

myds1.Fields(2) = Nz(myds4.Fields(8))

If so, the only thing that I can think of that might cause this is some sort
of corruption in the FE.  Have you tried a decompile/compile or importing
the FE into a new FE?

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: Wednesday, August 17, 2005 8:12 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Why is function being called??


My mistake DaysInMonth2 is a function. It is declared as an integer.
Thanks for looking.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bobby Heid
Sent: Wednesday, August 17, 2005 6:51 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Why is function being called??

I don't understand.  

You are saying that DaysInMonth is a function.  Yet your code has:
DaysinMonth = DaysInMonth2(myds3.Fields(1))

By this, DaysInMonth2 is the function.  How is DaysInMonth declared?  

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: Tuesday, August 16, 2005 5:24 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Why is function being called??


Below is a piece of code. DaysInMonth is a function. When the code runs
and hits the line  myds1.Fields(2) = Nz(myds4.Fields(8)) the function
runs. I don't see anything that is calling it. Your thoughts
appreciated.

 

Do Until myds4.EOF

    DaysinMonth = DaysInMonth2(myds3.Fields(1))

    If Day(myds3.Fields(1)) < DaysinMonth And RecordCounter = 1 Then

        StartCounter = Day(myds3.Fields(1))

        ProdDate = myds3.Fields(1)

    Else

        StartCounter = 1

        ProdDate = myds4.Fields(1)

    End If

        

    

    For I = StartCounter To DaysinMonth

        myds1.AddNew

            myds1.Fields(0) = ProdDate

            myds1.Fields(1) = myds4.Fields(0)

            myds1.Fields(2) = Nz(myds4.Fields(8))

        myds1.Update

        ProdDate = ProdDate + 1

    Next I

    RecordCounter = RecordCounter + 1

    myds4.MoveNext

Loop

 

Chester Kaup




More information about the AccessD mailing list