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