Results 1 to 2 of 2
  1. #1
    sjl is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    3

    Question VBA debuggin issues....

    I am trying to debug my VBA code (Access 2003). I set a break point, then tried to run the code to that point. Whenever I clicked on RUN | Run Sub/User Form, VBA popped up a window called "Macros".



    Thereafter, I found that I needed to be in Break mode to not get "Macro" window pop-up, However, the code still does not seem to run (break point does not get highlighted in yellow, nor can I get any values to come up in "bubble text" when mouse pointer hovers over a variable. And, when I ask the Immediate Window (when in Break mode) to "print" variable values, it returns a blank.)

    If I try to "Step Into" the code, I get this annoying background "beep"....telling me, I guess, that I can't step in.

    I am in a Private Sub Form_Load()... perhaps I can't step-into or "run" this type of code?

    thanks for any insights...
    -S


    this is the "guts" of the Sub:

    Private Sub Form_Load()

    'Turn on error handling
    On Error GoTo Cleanup
    Do While Not rst.EOF

    dtPacketDue = rst!dtmCOCExp
    strTo = Nz(rst!strSMName, "") 'study manager I NAME
    strCC = Nz(rst!strSMNameII, "") 'study manager II NAME null problem if declared as a string--declare as Variant
    strEM = Nz(rst!strEmail_SM, "") 'study manager I EMAIL
    strEM2 = Nz(rst!strEmail_SM2, "") 'study manager II EMAIL null problem if declared as a string--declare as Variant

    strproject = Nz(rst!strBrochureName, "")
    strprotocol = Nz(rst!strNIHProtocolNum, "")
    'When loading String Variable, use YourVar = Nz(rs!YourField,"") to make sure nulls are turned into
    ' ZLS (ZeroLengthStrings) MAY NEED TO DO THIS TO OTHER *STRING* VARS OR CHANGE *VARIANTS* TO *STRINGS* AND LOAD USING NZ()

    If IsNull(rst!dtmCOCApplic) And DateDiff("w", dtToday, dtPacketDue, vbThursday, vbFirstJan1) < 1 Then daysFromNowCOC120 = DateDiff("d", dtToday, dtPacketDue)

    If IsNull(rst!dtmCOCApplic) And DateDiff("w", dtToday, dtPacketDue, vbThursday, vbFirstJan1) < 1 Then
    Set objCDOMessage = CreateObject("CDO.Message")
    With objCDOMessage
    Set .Configuration = objCDOConfig
    .Subject = "IRB: Request for Confidentiality Certificate Due in 1 month " & "-- " & strproject
    .From = "Elizabeth O'"
    .Sender = "lein@xxxxxxx.xxx"
    .To = "lein@xxxxxxx.xxx"

    .HTMLBody = "<HTML><BODY><p> " & strTo & " <br /> " & strCC & " <br /> </p>" & _
    "<p>The Department <u>Confidentiality Certificate expiration date</u> for <b> " & strproject & " </b> </B> (protocol# " & strprotocol & ") is: <br /> <br /> </p>" & _
    "<p style=font-size:larger><b> " & dtPacketDue & " </b> <br /> <br /> </p> " & _
    "<p>This is <b> " & daysFromNowCOC120 & " </b> calendar days from now. Please make a note of it.<br /> <br /> </p>" & _
    "<p>IRB coordinator, </p>" & _
    "<p><i><b> Elizabeth O</b> </i> </p>"

    .Send

    End With

    End If
    rst.MoveNext

    Loop
    ..........

    rst.Close 'this closes the rst
    Set rst = Nothing
    Set db = Nothing

    CurrentDb.Close 'this closes Reg dbase, not access
    DoCmd.Quit
    End Sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You really need to "run" a form in order to do what you are trying. The Breakpoints will then work as you would expect.

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

Similar Threads

  1. query issues
    By 9944pdx in forum Queries
    Replies: 3
    Last Post: 01-12-2011, 06:34 PM
  2. 2 programming issues
    By gripper in forum Programming
    Replies: 3
    Last Post: 10-06-2010, 11:10 AM
  3. Message box issues.
    By thart21 in forum Programming
    Replies: 2
    Last Post: 05-29-2010, 12:58 AM
  4. printing issues
    By dmmartin in forum Programming
    Replies: 2
    Last Post: 05-29-2009, 08:22 PM
  5. Check Box issues
    By data123 in forum Forms
    Replies: 0
    Last Post: 01-03-2007, 03:21 PM

Tags for this Thread

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