I'm working on a new report in an MS Access DB.
The first anomaly was a message "This action will reset the current
code in break mode." when the report was run. Seems TB something
about my Detail1_Print() : if I answer "No" to the dialog the report
just runs. If I answer "Yes", it pops a new dialog seemingly at every
line. Code is below.
The real zinger, however, started on Friday. When I run the report
in question somehow MS Access just keeps on running - using 100% of
the CPU according to TaskMan.
Anybody seen anything like this?
Here is the report's entire module. Note that the "reset" dialog
keeps popping, so I guess it's nothing to do with Report_Open()
I'm thinking Detail1_Print() . OTOH, Detail1_Print() 's code is
something that I frequently clone from report-to-report and hasn't
given me any trouble to date.
----------------------------------------------------
Option Compare Database
Option Explicit
Dim mNoInput As Boolean
Private Sub Detail_Print(Ca ncel As Integer, PrintCount As Integer)
1000 debugStackPush Me.Name & ": Detail_Print"
1001 On Error GoTo Detail_Print_er r
' PURPOSE: - To notify user gracefully if there are no records to
list
' - To alternate shading of lines - giving a greybar
effect
1002 Static prvWhatever As String
Static wantShading As Integer ' Shade this row or not?
Const COLOR_SHADE = &HE8E8E8
Const DS_INVISIBLE = 5
Const expressionHasNo Value = 2427
1010 With Me
1011 If mNoInput = True Then
1012 .txtNoInput.Vis ible = True
1013 Cancel = True
1019 Else
1020 If .txtCusip <> prvWhatever Then
1021 wantShading = Not wantShading 'Alternate the
value of wantShading
1029 End If
1030 If wantShading Then
1031 .DrawStyle = DS_INVISIBLE
1032 Me.Line (.txtCusip.Left , 0)-(.Width,
..Section(0).He ight), COLOR_SHADE, BF
1033 End If
1034 prvWhatever = .txtCusip
1039 End If
1999 End With
Detail_Print_xi t:
debugStackPop
On Error Resume Next
Exit Sub
Detail_Print_er r:
bugAlert True, ""
Resume Detail_Print_xi t
End Sub
Private Sub Report_NoData(C ancel As Integer)
debugStackPush Me.Name & ": Report_Open"
On Error GoTo Report_Open_err
mNoInput = True
Report_Open_xit :
debugStackPop
On Error Resume Next
Exit Sub
Report_Open_err :
bugAlert True, ""
Resume Report_Open_xit
End Sub
Private Sub Report_Open(Can cel As Integer)
1000 debugStackPush Me.Name & ": Report_Open"
1001 On Error GoTo Report_Open_err
' PURPOSE: - To prevent opening the report if any held
tblCusip.Deriva tive=True are
' missing from Jack's spreadsheet or have missing
values on same
' - To solicit the "As-Of" date TB printed in the report's
header
1002 Dim myRS As DAO.Recordset
Dim myDate As Control
Const ssPath_Missing = "C:\Tob_Missing .xls"
Const ssPath_ZeroOrNu ll = "C:\Tob_ZeroOrN ull.xls"
Const queryName_Missi ng =
"qryTobMaxRate_ Cusips_Spreadsh eetMissing"
Const queryName_ZeroO rNull =
"qryTobMaxRate_ Cusips_Spreadsh eetZeroOrNull"
1003 DoCmd.Hourglass True
1009 StatusSet "Validating spreadsheet input..."
1010 Set myRS = CurrentDb().Ope nRecordset(quer yName_Missing,
dbOpenSnapshot, dbForwardOnly)
1011 With myRS
1012 If Not ((.BOF = True) And (.EOF = True)) Then
1013 DoCmd.OutputTo acOutputQuery, queryName_Missi ng, "Microsoft
Excel (*.xls)", ssPath_Missing
1014 MsgBox "One or more held securities are missing from the
TobMaxRates spreadsheet." & vbCrLf & "Please contact an analyst and
have them added before trying to rerun." & vbCrLf & vbCrLf & "A list
of missing securities has been created in '" & ssPath_Missing & "'.",
vbCritical, "Cannot Open Report"
1015 Cancel = True
1016 End If
1017 .Close
1019 End With
1020 Set myRS = CurrentDb().Ope nRecordset(quer yName_ZeroOrNul l,
dbOpenSnapshot, dbForwardOnly)
1021 With myRS
1022 If Not ((.BOF = True) And (.EOF = True)) Then
1023 DoCmd.OutputTo acOutputQuery, queryName_ZeroO rNull,
"Microsoft Excel (*.xls)", ssPath_ZeroOrNu ll
1024 MsgBox "One or more securities on the TobMaxRates
spreadsheet have a MaxRate value that is zero or missing altogether."
& vbCrLf & "Please contact an analyst and have values added before
trying to rerun." & vbCrLf & vbCrLf & "A list of missing securities
has been created in '" & ssPath_ZeroOrNu ll & "'.", vbCritical, "Cannot
Open Report"
1025 Cancel = True
1026 End If
1027 .Close
1029 End With
1030 StatusSet ""
1040 If Cancel = False Then
1041 If productionModeG et() = False Then
1042 Me!txtTestingBa nner.Visible = True
1049 End If
1050 With DoCmd
1051 .OpenForm "frmGetDate ", , , , , acDialog, Me.Name
'Code pauses here until user closes frmGetDate
1052 .Hourglass False
1053 Set myDate = Forms!frmHome!t xtBeginDate
1054 If Val(myDate.Valu e & "") = 0 Then
'User cancelled out of date solicitation dialog
1055 Cancel = True
1056 Else
1057 Me.txtReportHea der.ControlSour ce = "=" & Chr$(34) &
"Tender Option Bonds/Max Rates As Of: " & Format$(myDate. Value,
"yyyy/mm/dd") & Chr$(34)
1058 End If
1059 End With
1999 End If
Report_Open_xit :
debugStackPop
On Error Resume Next
myRS.Close
Set myRS = Nothing
Exit Sub
Report_Open_err :
bugAlert True, ""
Resume Report_Open_xit
End Sub
---------------------------------------------------- 1 2682
Pete,
Wild guess #1: is the implicit test causing a problem (vague recollection
from A97 days)?
Wild guess #2: try explicitly closing and setting to 'Nothing' your DAO
objects when you have finished with them, in reverse of the order they were
created.
Wild guess #3: references issue - DAO vs ADO - in which order are they
declared?
Just my $0.02
Doug
--
Remove the blots from my address to reply
"PeteCressw ell" <Go**********@F atBelly.com> wrote in message
news:74******** *************** **@posting.goog le.com...
<snip> Static wantShading As Integer ' Shade this row or not?
<snip>
Doug***Not initialised - but why would that make a difference***
1021 wantShading = Not wantShading 'Alternate the value
<snip>
Doug***This is the implicit test I am wondering about*** 1030 If wantShading Then
<snip> ---------------------------------------------------- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Saqib Ali |
last post by:
Howdy Folks,
I have a b/w fotograf that i am displaying on a website using the
width="100%" attribute so that it spans the width of the web browser
The rosolution of the picture is 1296 x 204. However when I display it
with width="100%", it doesn't look good anymore.
Here is the URL to the picture if you want to view it:
http://www.xml-dev.com:8080/cocoon/mount/docbook/
|
by: Hodad |
last post by:
I would like to adapt, as much as possible, the appearance and color red
of the
font in this button:
<P><CENTER><BUTTON VALUE="SUBMIT"><A
HREF="http://www.familytreedna.com/surname_join.asp?code=Q17978"
STYLE="TEXT-DECORATION: NONE;">
<FONT COLOR="RED" FACE="COPPERPLATE GOTHIC BOLD">Right
Here</FONT></A></BUTTON></CENTER></P>
|
by: Aryeh M. Friedman |
last post by:
Why is the value of "Instance" whacked in the following code. Note this
only happens in Graph::*Wrapper.
Also please note that if I hardcode WalkFunc and PrintFunct to be
BredthFirst and BredthFirstPrint and make both approriate func ptrs it works
fine.
void print(void *data);
#define R 'r'-'r'
#define S 's'-'r'
|
by: tnhoe |
last post by:
Hi,
<Form method='post' action="next.htm?btn="+"this.myform.myobj.value">
What is the correct syntax for above ?
Regards
Hoe
|
by: YFS DBA |
last post by:
I'm getting an error message when I open queries then try to close them:
"This action will reset the current code in break mode"
Clicking on 'Yes' just brings up the same message. If I change to Design
mode, I can close the query.
I've installed SP-3, which I thought would cure the problem, to no avail.
It usually happens after I've opened my Internet browser (IE6).
| |
by: PeteCresswell |
last post by:
I don't *think* anything's running.... I haven't interrupted the code
or anything.
But the message seems to imply that some process really is running.
Anybody been here?
|
by: craig.keightley |
last post by:
I am trying to get the next row within a loop for a script i am
developing...
I need to display a final table row within the table that i have
displayed on the page, but i only want to show it if value of the
current field is not the same value of the next row.
eg:
|
by: Sanders Kaufman |
last post by:
I'm having a BLAST writing this app as OOP as PHP allows. It's one
thing to discuss the dance, but it's a thing of beauty to see the
performance.
I'm noticing that the constructor is a "reset" switch - just like the
one on the front of my computer. Calling it seems to just dump all of
the old values, free up all of the old resources, and return the object
to a pristine state.
However, I'm a *little* concerned about just using the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |