Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Can't test code - "Debug" - "Run to Cursor"


    In wanting to simply test some code, I can't even get "Debug" to "Run to Cursor" when placing the cursor at the "End Sub" statement. What would block that action?
    Code:
    Private Sub TestingOnly(Cancel As Integer)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    ' Sub-Report RecordSource will automatically get the records corresponding to the "New" and
    ' "Renewal".  However, we need to get the count of each for the main report and calculate
    ' the corresponding dollar amount.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    Dim intNoN As Integer
    intNoN = PCCodeCount("N", "01/21/2016")
    
    End Sub
    Public Function PCCodeCount(ChrCode As String, PerDate As Date)
    PCCodeCount = DCount("[PCCode]", "tblMembers", "([DOPmt] > #" & PerDate & "#)")
    
    End Function

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    the code needs to be in a standard module - not a form module

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Yes, this is in a standard module.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    in that case it is because your sub has parameters


    create a new sub

    Code:
    Private sub test
    
        testingonly false
    
    end sub
    and run that - or remove the parameter - you are not using it anyway

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    HaHa That code got deleted in that its permanent location is in the "Activate" event of the report we discussed in an earlier thread.

    And yes, now that you point out about parameters it's clear that that was the problem. Having taken that segment of code from "The Report's" Open event and just changing the name of the sub didn't also remove the normal parameter list of an Open event.

    I might end this day on a happy note!
    Thanks,
    Bill

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 12-23-2015, 09:32 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 1
    Last Post: 11-13-2014, 02:54 PM
  4. Replies: 4
    Last Post: 07-12-2014, 02:02 PM
  5. Replies: 0
    Last Post: 01-11-2012, 12:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums