Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 21st, 2006, 04:45 PM
ortaias@hotmail.com
Guest
 
Posts: n/a
Default 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?

  #2  
Old February 21st, 2006, 05:25 PM
Lyle Fairfield
Guest
 
Posts: n/a
Default Re: Rebuild Form From Scratch?

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

  #3  
Old February 21st, 2006, 10:55 PM
Albert D. Kallal
Guest
 
Posts: n/a
Default Re: Rebuild Form From Scratch?

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
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal


  #4  
Old February 22nd, 2006, 03:35 PM
ortaias@hotmail.com
Guest
 
Posts: n/a
Default Re: Rebuild Form From Scratch?

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.

  #5  
Old February 22nd, 2006, 04:55 PM
ortaias@hotmail.com
Guest
 
Posts: n/a
Default Re: Rebuild Form From Scratch?

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.

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles