Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: Code pauses for no reason what so ever

    for some reason my code executing pops open the vba debuger and stops on this line. There is no break point here. but it just stops,

    the computer was powered down, access restarted and it happend agian

    Public Function MonthlyInterest()
    Dim MySql As String
    Dim setDate, FillDate As Date, DateEntered As Date, StartDate As Date, TempFilter As Date, PrePeriodFilter As Date, SetOrigAmt, Payment, PortID, cpnType, PrePeriodPmts As Variant, GroupFlag As Variant, PeriodFilter As Date
    Dim classsize, tradebal, tradebal2 As Double, rsttradebal, rsttradebal2, rstPrePeriodPmts As Recordset, rategroupflag As Recordset
    Dim PaidOff As Double

    MySql = "Delete * from tblAccruedInterestGlobal"

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Which line? Is there more?
    Paul

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    try a recompile
    try a compact and repair
    try debugging
    how long is it taking the mySQL server to do somethign
    have you trapped for any errors in the server

    looking at your code there are an awfull lot of variants declared there.. generally its better to declare explicitly what datatype each variable should be rather than leaving them as variaints.

    just wondering if mebbe MySQL is a reserved word in the ODBC interface,.. may be worth trying strMySQL.... or strSQL

    Im not sure Delete * from tblAccruedInterestGlobal is valid MySQL SQL. try it in MySQL query browser, or does MySql just mean My SQL line?.. if so ignore the last bit Delete * from tblAccruedInterestGlobal is valid in MS Access SQL. mind you deleting the accrued interest seesm a very odd thing to do, I suspect the data model may need refining, unless you have good performance reasons for doing so.

  4. #4
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    no offense, but your code could be cleaned up. Organize your declarations by type.

    Do you have the correct libraries reference?
    Do you need to specify ADO or DAO recordsets in your Dim statements?

    Public Function MonthlyInterest()
    Dim MySql As String
    Dim setDate, FillDate, DateEntered, StartDate, TempFilter, PrePeriodFilter, PeriodFilter As Date
    Dim SetOrigAmt, Payment, PortID, cpnType, PrePeriodPmts, GroupFlag As Variant
    Dim classsize, tradebal, tradebal2, PaidOff As Double
    Dim rsttradebal, rsttradebal2, rstPrePeriodPmts, rategroupflag As Recordset
    MySql = "Delete * from tblAccruedInterestGlobal"

    End Function

  5. #5
    Join Date
    Oct 2003
    Posts
    233
    i figured it out, someone left a break point in and for some reason when i remoted to the other comp i couldnt see the break point, i cleared all break points and its fine now

  6. #6
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Great.

    just out of curiousity... what do you mean you "remoted to the other comp"?
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    as far as I'm aware
    Dim setDate, FillDate, DateEntered, StartDate, TempFilter, PrePeriodFilter, PeriodFilter As Date

    creates one variable of type Date.. Periodfilter
    .. the rest are of type variant

    if you want a specific data type then you have to declare the datatype
    Dim setDate as date
    Dim FillDate as date

    it could be that this changed somewhere down the line.. but it was definitely the case in VB6...
    mind you I'd also 'like' to define what they are
    Dim setDate as date 'include some comment about what this variable is for
    Dim FillDate as date


    just my 2.5d

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    That's the way I believe it still is healdem.

    As for a remoting in, I do it a lot too, using my system in the office to connect to another computer to control it for support or whatnot.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •