debug.print

steve_4477

Registered User.
Local time
Today, 06:00
Joined
Jan 10, 2011
Messages
23
Gentlemen,

When I use a function which contains debug.print in the Immediate Window it produces a string of characters i.e.

3 yrs, 1.15%
5 yrs, 1.65%

How I translate this to a message box? Or even one step further into the body of an email via my .body = [some vba code].

Please advise.

Thanks for the help!!

Steve
 
What is the code for the function?

Debug.Print just outputs to the Immediate Window so whatever it is outputting (the part that comes AFTER the .Print part is what you can use in other ways too).
 
Thanks Bob,

So, I guess my question is how do I do that? My function uses a loop

For x = 1 To y

Debug.Print Forms!FRM_TransactionDetailsEdit!PricingList.Column(2, x - 1) & " yrs, " & Format(Forms!FRM_TransactionDetailsEdit!PricingList.Column(9, x - 1), "#.00%")

Next

Which gives the

3 yrs, 1.15%
5 yrs, 1.65%

in the Immdeiate Window.

So how do I take the loop without the debug.print and translate that into the body of an email??
 
Code:
Dim strHold As String
 
For x = 1 To y

[B]strHold = strHold & [/B]Forms!FRM_TransactionDetailsEdit!PricingList.Colum n(2, x - 1) & " yrs, " & Format(Forms!FRM_TransactionDetailsEdit!PricingLis t.Column(9, x - 1), "#.00%") [B]& vbCrLf[/B]

Next
And then you would need to do up all of the code to put out an email. Are you using Outlook? If so, it should be easy to find VBA code for "Microsoft Access VBA Send Outlook Email" by Googling and then using that string as your body when you have the outlook object.
 
Awesome!

Let me try this out. I already have the email code going and just need to be able to insert this into the .body portion.

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom