473,473 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Rebuild Form From Scratch?

A couple of my forms may be corrupted. I am using ACCESS2000. I have
noticed that on a couple of forms, my computer's CPU usage hits 100%
and stays there. Running the compacting/repair tool only provided
temporary relief. These forms have been checked for "bad" code, but
none was observed, also these forms previously did not seem to eat-up
the CPU usage. I am assuming that the best strategy to solve this
problem would be to rebuild these forms from scratch. Any thoughts?

Feb 21 '06 #1
4 1850
You could try this:

Public Sub RenewObject( _
ByVal ObjectName As String, _
ByRef ObjectType As AcObjectType)
Dim TempName As String
Dim FileName As String
TempName = ObjectName & Format(Now(), "yyyymmddhhnnss")
FileName = TempName & ".txt"
' save this code before running

' make a safe copy of the object
DoCmd.CopyObject , TempName, ObjectType, ObjectName

' save the object as text
SaveAsText ObjectType, ObjectName, FileName

' load the object as text ... if corruption then error
' original object is OVERWRITTEN without warning
LoadFromText ObjectType, ObjectName, FileName

' remove text file
Kill FileName
End Sub

Sub test()
RenewObject "Form1", acForm
End Sub

Feb 21 '06 #2
no, I don't think rebuilign from scratch is needed here.
first, does the code compile..and can you create a mde file?

2nd...did you turn off the track-name autocorrect?

3rd...there was a ZILLION bug fixes included in the service packs for office
2000. Have you installed the updates?

And, another thing to check is there any timer function running?....often
people don't realize that the timer event for a form is set in
milli-seconds...

so, they enter 20...and that means every 20 millisencd the code will execute
(that is what..500 times a second???)....

So, check the above. I would first try this as a mde..and see if the problem
still exists.

Access97 used to always max out the cpu...and it was a known problem.
However, the windows tasking system would gracefully slice out the time
anyway..(in other words...while the CPU did show 100%...it does give up the
time slice anyway).

The above problem was fixed in a2000.....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Feb 21 '06 #3
Thanks, using Access2000. On one form this problem appears to be fixed.
It has to do with the "stLinkCriteria" criteria being undefined. I
used the access wizard on a command button to open a new form (at least
that was the intent). The code should have had "acFormAdd" instead it
had "stLinkCriteria". Correcting the code to "DoCmd.OpenForm stDocName,
, , , acFormAdd" seems to have fixed it. I assume that the jump in CPU
usage was caused by Access searching for a value for "stLinkCriteria".
Now I need to check the other forms, when I get a chance, to see if a
similar fix can be applied. Unfortunately, I received a bunch of work
projects, so I will have to put fixing the program on the backburner
for a while.

Feb 22 '06 #4
Evidently, my belief that the problem may have been solved was
premature. Upon reopening the form to enter my work, the CPU usage
jumped back to nearly 100% occassionally, it would drop down to near
0%. Will have to check it out more.

Feb 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Roman Schicht | last post by:
I have an 9i RAC on W2K-Advanced Server with 2 Nodes. The 2nd Node has to be reinstalled from scratch for a problem with Windows. What must be done (before and) after ReInstallation, that the RAC...
25
by: MLH | last post by:
In an earlier post entitled... "A97 closes down each time I open a particular report" it has been suggested that I rebuild problematic table - one in which some corruption has occurred. I...
2
by: Alpha | last post by:
Hi, I just added a new form with Crystl report viewer but one of my other form suddently starts giving me an error message when I rebuild the code. The error is complainig about the class name. ...
4
by: gsilvey | last post by:
Is there a way to rebuild the code that is generated by the forms designer? It compiles, but it seems to have controls left in it that I previously removed using the designer. I'd like to just...
3
by: S P Arif Sahari Wibowo | last post by:
Hi! I would like to make an editable continous form, where most fields will be from table A and editable, except 1-3 fields are a glimpse into table B and uneditable. Table A relate to table B...
5
by: Bob | last post by:
I made a code change to a form , then saved it and tried to go to design mode in the form. I get an error message (there seems to be a dataset defintion that can no longer be initialled apparently...
8
by: TomC | last post by:
I want to bypass the Windows Form Designer in VS, to create a form programmatically. The elements of the form are to be arranged in a table, and I want the size of the table (and therefore the...
1
by: Johnny Jörgensen | last post by:
Can anybody please clarify to me what the difference between Build and Rebuild is in Visual Studio 2005? Cheers, Johnny J.
16
by: Wayne | last post by:
I've read that one method of repairing a misbehaving database is to save all database objects as text and then rebuild them from the text files. I've used the following code posted by Lyle...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.