debug.print

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].

Sponsored Links:

Related Topics

VS2010 Service attaching to a remote debugger symbols will not load to set a breakpoint
I have a Vb.Net 4.0 Windows Service. The service is setup to run in DEBUG with generate debug set to pdb-only.
Configuration is set to debug.

Installer project is set to DEBUG. VS IDE is set to debug.

I do a clean build and clean install of the DEBUG version. I run x64\msvsmon.exe on remote machine (W2008 R2 64bit). I attach to the process via workstation (XP PRO 32bit) in VS2010 without issue. Everything is set to debug but I get the infamous message breakpoint will not currently be hit,


Cannot enter the project to debug mode
I have a project that was download from the net. It is a open source project. I can run without anyerror with IDE 2005. But I cannot enter the debug mode. I have set the project build to debug. But I cannot still enter to debug.

I also got the following message when I run the project.

The following module was built with optimizations enabled or without debug information:
E:\Project.exe

To debug this module, change its project build configuration to debug mode. To suppress this message, disable the "Warn inf no user code on launch" debugger option


Not stopping at Breakpoints in Debug mode
I am using VS2010 with Win7 and VB.NET solution. Between, everything was working fine for months; the problem started yesterday.

The solution and the projects within it are set for Debug; I deleted the .suo file as recommended in one posting. I ran rebuild on each and every project individually and the entire solution.

I deleted the files in bin\Debug and did the whole thing over again. Still can't debug.

While stepping into (F8) I did get the hollow debug symbol in the margin and when just running the program (F5) the program starts up without stopping at any of several breaks in different functions and subs.


disable debug error
how to disable debug error in ms access vb,
I mean when I open a form some time showing debug error this is being a disadvantage due user using and user can be edit, if debug error just I want OK button only


Compile Error Syntax Error
Wonder if anyone can help
I get an syntax error when compiling the code below.
Any help will be much apprediated.

Private Sub Command105_Click()
If IsNull(Me!Encryption_Password) Then
Me!Encryption Password = DMin("[Encryption_Password]", "QueryEncryption", "[Encryption_ID]=" & Me!Encryption_Password)
Debug.Print DMin("[Encryption Password]", "QueryEncryption")

Debug.Print LaptopID, Me!Encryption_Password


VBA doesn't recognzie variable's contents
I have declared a public variable in my form's vba code

[code]

Returns goes back to the original code.

But when I check the value of the variable in the originals form code with a msgbox. it is blank.

When the code finishes running (there is just one or two lines of code which do not affect the variable). I debug.print strinput and it has a value.

Why does debug.print recognize the value of the variable but the code within the form (it is an afterclick event subroutine) not recognize it? The public variable is declared in the original form.


Debug not working in 64bit
I've downloaded the 64bit debug symbols and told the IDE where they were located. But for some reason, VS won't build a 64bit debug EXE.

This is my first time doing 64bit so I never had to worry about it before. Is there something I need to do in the IDE that I don't know about? I went to Project Properties and set things to 64bit debug. But when I compile the program, it makes a 32bit program.


I can't debug my code in VB6 IDE
I'm trying to debug the code in VB IDE. This IDE is able to debug the console VB Scripts. But in our project, we are generating the HTML pages using the VB. We wrote the .cls modules for that.

When I try to debug this .cls modules, the control is not going to the particular code line. the properties of my project is alright.


Best practice for print preview and print a report
Typically when you print something, you get a print preview (with focus) and then print dialog to print to a printer of choice. How can you accomplish this ni Access 2007? I can go straight to print, and I can preview (unfocused tab) or preview as popup, then magnify/demagnify with mouse and click ribbon print button.


Access - Eval function
this is my problem
I need to use <EVAL> function for my db, but it does not run.
Example: if I execute this routines (sure enough I build my string)

Sub ChangeIcon() Dim mStr As String mStr = "CommandBars(18).Controls(1).FaceId" Debug.Print Eval(mStr) End Sub

all works well and I see the result (67 for example)
But if I want to change the FaceId, the routines don't show any error, but che FaceId is non changed

Sub ChangeIcon() Dim mStr As String mStr = "CommandBars(18).Controls(1).FaceId" Eval (mStr & "= 3") Debug.Print Eval(mStr) End Sub

value returned always


How to resolve 30/12/1899 as Date??
forum, I have included in my code to append records to a table as the code Loops.

In the Immediate Window, the records show correctly with correct dates.
But the Appended Records all show as 30/12/1899

I am pretty sure this date is incorrect as I wasn't even born then although sometimes my children would have thought so

Here is the Insert into sql which results in 30/121899

sqlString = "INSERT INTO TblLateFeeCalculated ( LDPK, LateFeeAmount, LateFeeDate ) " & vbCrLf & _
"VALUES (" & LoanID & ", " & LateFeeNow & ", " & CommenceDate & ");"
DoCmd.RunSQL sqlString

yet this Debug.Print results in the correct Non US date

Debug.Print LoanID & " " & LateFeeNow & " " & CommenceDate


CurrentDb <> DBEngine(0)(0)
CurrentDb should be equivalent to DBEngine.Workspaces(0).Databases(0) or DBEngine(0)(0) for short.

I always use CurrentDb because it is easier to type. In the code below Currentdb creates an error while DBEngine(0)(0) doesn't. Why is that?
When is one prefered above the other?

Public Sub EchoFieldnames()
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
'
Set tdf = CurrentDb.TableDefs("tblCRB_IMPORT") 'Creates error:3420: Object invalid or no longer set.
Set tdf = DBEngine(0)(0).TableDefs("tblCRB_IMPORT")
For Each fld In tdf.Fields <<<<where the error occures
Debug.Print fld.name & ":";
Next fld
Debug.Print
End Sub

I use this code to get the fieldnames behind eachother with a : separator.


Access 2003/ VBA form filter problem
I have created a form which I want to launch from VBA. I tested the form in the Access UI and was able to roll through the table contents, editing and adding as required.

I then added the following line to another form to call the form:

1) DoCmd.OpenForm "FAso", , , "[DS]='" & Me.DN & "'", , , Me.DN
The form correctly launched a few times but now it will not. Further, when I now open the form in the UI, it does not show any records until I select RECORDS/ REMOVE FILTER, even thoughthere is no filter set in the property and FLTR is not shown in the status bar.

I checked the status in VBA ON FORM OPEN using:

1) Debug.Print "Me.Filter is ", Me.Filter >> “”
2) Debug.Print "Me.FilterOn is ", Me.FilterOn >> “false”
Is appears as though a filter is permanently set. I ran the compact and repair but no change.


How to Print current Transaction?
I have a form where I perform some test and go to print command which is supported by a report for tests.

right now I have put query which ask 1st which test no want to print so I just put testno and print the page but I am looking to print as I enter the record and go to print so must print the last transaction only?

how it can be plz?


TempVars monitoring for debug
Does anyone know of a method to monitor when temporary variables are created/updated/removed?

Something like a monitor window that opens to the side so we can debug.


Debug errors using my search function
I have come across an issue with my database search query.

I have a field in my table set as text because I want to use numbers and/or letters in the values I enter into it.

When I try searching for a numeric value that I know is listed in the table I get a debug error as follows:
Runtime error "3464" Data type mismatch in criteria expression

When I try searching for the value that is letters only I get debug error as follows:
Rumtime error "2001" You cancelled the previous operation.

The me.volume section of the code is the field that the code refers to. the dCount section of the code is where the debug highlight appears...


prevent exit fromcurrent record on continuous sub-form
I have a continuous sub form to which the user adds new records
the validation rules & tab stops vary depending on the value in the first and sometimes the second field of the subform

Problems arise when the user decides to edit a control in previous entry

I am trying to prevent the user from exiting the current record until they reach the final command button on the subform

here is what I have done
but when I get to the caseCost button the form will not tab to the next record

Private Sub Form_Dirty(Cancel As Integer) isflagUp = True End Sub

Private Sub Form_BeforeUpdate(Cancel As Integer) Debug.Print isFlagUp
If (isFlagUp) Then
MsgBox msgtxt, vbCritical, msgCaption
Cancel = True End If
End Sub

Private Sub CaseCost_GotFocus() isFlagUp = False Me.CaseCost.ForeColor = vbBlue Me.Latest_Eligibility_Code.Enabled = False Me.Latest_Eligibility_Code.Locked = True Me.Latest_Eligibility_Code.TabStop = False Debug.Print isFlagUp


Print your Access data
When you print data from your Microsoft Office Access 2007 database, the options you set depend on what kind of object you are printing and how you want your data to appear when printed. This article shows you the basic print options available, and how to change print layout options.
What do you want to do?
* Select a print option
* Make page layout changes before printing
* Print a table relationship diagram
* Print a datasheet
* Print specific records from a datasheet
* Print a form
* Set print options for a module


Form - Top of other forms
I have application with toolbar. When I run the form in debug mode after completing debug form is not opened (Please see the screeshot attached). I need to close the form and open it again.Is there anyway to keep that form open in debug mode (Top of other forms)


Debug on validation check
I have the following code which looks at a MVF combobox for a repsonse.

If Me.cboDwellingLowerFloorStructure <> "" Then

However it give s debug Type Mismatch error.

However if I remove the multivalue it works.

Any ideas how I can get it to validate that question has been answered