Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Access 2000 DB to 2002 3

Status
Not open for further replies.

deisehun

Programmer
Nov 24, 2006
182
IE
I have an XP Client with office XP installed.

I have an Access 2000 DB with numerous forms, tables, queries etc.

When I click on one particular form on any Client with Office XP, it immediatly kicks me out of the DB.

I tried to convert the db to version 2002 - it looks like it's working - I select a new file location, but the original file is 30Mb and converted db is only 1.6mb

Any ideas where I'm going wrong?

Thanks..
 
It may simply be that the original database was never compacted, and during the conversion process it automatically compacted it.

 
The same thing happens though - i.e kicks you out if you try and open that form.

Heres the code behind the form, if it makes any sense to you - to give any pointers of what I should check for:

-----
Option Compare Database

Private Sub Command43_Click()
DoCmd.OpenQuery ("qry products to be ordered")
End Sub

Private Sub Command44_Click()
DoCmd.Close acForm, "form proposal"
DoCmd.OpenForm "form update ERP data"
End Sub

Private Sub Command45_Click()
DoCmd.OpenTable "tbl scheduled concentrates"
End Sub

Private Sub Command53_Click()
DoCmd.OpenTable "tbl Safety stock weeks"
End Sub

Private Sub Command54_Click()
DoCmd.OpenQuery ("qry upload SS FG export")
DoCmd.OpenQuery ("qry upload SS FG calculation")
End Sub

Private Sub Command55_Click()
DoCmd.OpenQuery ("qry open concentrate orders per item")
End Sub

Private Sub Command56_Click()
DoCmd.OpenQuery ("qry open concentrate orders summary")
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub

Private Sub Proposal_Click()
On Error GoTo Err_Proposal_Click

Dim stDocName As String

stDocName = "report production proposal"
DoCmd.OpenReport stDocName, acPreview

Exit_Proposal_Click:
Exit Sub

Err_Proposal_Click:
MsgBox Err.Description
Resume Exit_Proposal_Click

End Sub
Private Sub Command52_Click()
On Error GoTo Err_Command52_Click


Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_Command52_Click:
Exit Sub

Err_Command52_Click:
MsgBox Err.Description
Resume Exit_Command52_Click

End Sub

---------------

Thanks..
 
Also, other Command buttons on the same form (within the same db) work fine on the client that this happens on.

Thanks
 
That particular form appears to be corrupt. Try doing a decompile (then compile the project again).

Run something like this in a command window:
Code:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /decompile "C:\Projects\MyDatabase.mdb"

 
Try the decompile first, but...

I had exactly the same problem with an Access 2000 database when we moved to 2003. There was one control on the form (a textbox, I think), rather than the form itself, that was corrupt and preventing the form from opening. When the form was opened in normal view MS Access would crash. You could however open the form in design view.

This was a while ago, but if memory serves decompiling didn't work for me. I believe I had to work out which control was causing the problem (by deleting them one at a time and attempting to open the form) and then recreating the problematic control.

Fortunately my form only had half a dozen controls, so it didn;t take very long. It could be a real pain in the bum if the problem is with a really big for.

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks for the help guys.

When I run the decompile command, it simply calls up the troublesome form and when I run the form again, it kicks me out.

Is there something else I should be doing when I run the decompile command?

 
It looks like you will need to recreate the form. You can try Ed's suggestion of removing controls one at a time. If you have to start from scratch you should at least be able to copy the VBA code from the old form.

Sorry, but that's Access for you.


 
Thanks again - one last stupid question

How do I recreate the form?
 
Create a new form, put all the same controls in as the one not working. If you can get into the VB module for the existing form, copy and paste the code from the old to the new form.

 
I've recreated the form and pasted in the code behind it etc, but it still just kicks me out.

Any other ideas?

Thanks
 
You could try creating a new blank form and setting the property "HasModule" to No.

Then go into design view of your corrupt form, copy all the controls and paste them into the new form.

you should now have a new form with the same controls but no code.. try going into form view and let us know what happens..

if it crashes then it points to a control being the problem, but now you have a duplicate form..keep deleting a control as mentioned before and going into form view..hopefully at some point it will work ok and the last control you deleted was the problem.

if it doesn't crash first time .. then select all the vba code from the original. On the new form change the setting "HasModule" to yes , then paste the code into the VBA editor for the form, compile it ..close and reopen the form. See what happens...



Hope this helps!

Regards

BuilderSpec
 
Thanks Builder, how can I change the setting 'HasModule'?
 
open you form in design view..

form properties...
"other" tab

Has Module should be listed there

Hope this helps!

Regards

BuilderSpec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top