By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 986 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Error accessing the system registry

P: 3
I installed Office 2000 Professional onto a Windows Vista laptop and when I tried to compile the code the following error message appears:

'User-Defined type not defined'

I went to check the registry and the following message appears:

'Error accessing the system registry'.

I have tied to repair Access using the Office 2000 repair facility but no luck.

Do you have any suggestions on this problem.

Thank you
May 19 '07 #1
Share this Question
Share on Google+
7 Replies


ADezii
Expert 5K+
P: 8,619
I installed Office 2000 Professional onto a Windows Vista laptop and when I tried to compile the code the following error message appears:

'User-Defined type not defined'

I went to check the registry and the following message appears:

'Error accessing the system registry'.

I have tied to repair Access using the Office 2000 repair facility but no luck.

Do you have any suggestions on this problem.

Thank you
Post the code that you were attempting to compile.
May 19 '07 #2

P: 3
I forgot to mention that error occurs when I try to look at the references in the Visual Basic window.

Here is a sample of the code. There is no problem with it on an XP laptop.
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Sub cboProperty_AfterUpdate()
  5.  
  6. Me.cboFlat.Requery
  7.  
  8. End Sub
  9.  
  10. Private Sub cmdClose_Click()
  11.  
  12. On Error GoTo Err_cmdClose_Click
  13.  
  14. DoCmd.OpenForm "frmMainMenu", acNormal
  15. DoCmd.Close acForm, "frmReports"
  16.  
  17. Exit_cmdClose_Click:
  18.     Exit Sub
  19.  
  20. Err_cmdClose_Click:
  21.     MsgBox Err.Description
  22.     Resume Exit_cmdClose_Click
  23.  
  24. End Sub
  25.  
  26. Private Sub cmdLabelP1_Click()
  27.  
  28.  
  29. DoCmd.OpenReport "rptOwners_Labels", acViewPreview
  30. DoCmd.RunMacro "mrToolbar.ShowPrintTool"
  31. End Sub
  32.  
  33. Private Sub cmdLabelP2_Click()
  34.  
  35. DoCmd.OpenReport "rptOwners_Labels_P2", acViewPreview
  36. DoCmd.RunMacro "mrToolbar.ShowPrintTool"
  37. End Sub
  38.  
  39. Private Sub cmdPrint_Click()
  40.  
  41. Dim Msg As String, Msg2 As String, Response As String, Style As String
  42.  
  43. Msg = "There are no Arrears for " & "" & Forms![frmReports].[cboProperty].Column(1)
  44. Style = vbOKOnly + vbInformation + vbDefaultButton1
  45.  
  46. Msg2 = "There are no Outstanding Actions for " & "" & Forms![frmReports].[cboProperty].Column(1)
  47.  
  48. On Error GoTo Err_cmdPrint_Click
  49.  
  50. If Me.lstReports = "rptInvoice" Then
  51.     DoCmd.SetWarnings False
  52.     DoCmd.OpenQuery "qupdInvoicesPrinted"
  53.     DoCmd.SetWarnings True
  54. End If
  55.  
  56. If Me.lstReports = "rptServiceChargeArrearsRpt" Then
  57.     DoCmd.SetWarnings False
  58.     DoCmd.OpenQuery "qdelServiceChargeArrearsTotal"
  59.     DoCmd.OpenQuery "qappServiceChargeASrrearsTotalCY"
  60.     DoCmd.OpenQuery "qappServiceChargeASrrearsTotalPY"
  61.     DoCmd.SetWarnings True
  62. End If
  63.  
  64. If Me.lstReports = "rptInvoiceArrears" And IsNull(DLookup("[PropertyID]", "qselInvoicesArrearsRpt")) Then
  65.     Response = MsgBox(Msg, Style)
  66.     If Response = 1 Then
  67.         GoTo 10
  68.     End If
  69. End If
  70.  
  71. If Me.lstReports = "rptGroundRentArrears" And IsNull(DLookup("[PropertyID]", "qselGroundRentArrears")) Then
  72.     Response = MsgBox(Msg, Style)
  73.     If Response = 1 Then
  74.         GoTo 10
  75.     End If
  76. End If
  77.  
  78. If Me.lstReports = "rptPropertyActions" And IsNull(DLookup("[PropertyID]", "qselPropertyAction")) Then
  79.     Response = MsgBox(Msg2, Style)
  80.     If Response = 1 Then
  81.         GoTo 10
  82.     End If
  83. End If
  84. 'rptPropertyActions
  85. DoCmd.OpenReport Me.lstReports, acViewPreview
  86. DoCmd.RunMacro "mrToolbar.ShowPrintTool"
  87.  
  88. 10
  89.  
  90. Exit_cmdPrint_Click:
  91.     Exit Sub
  92.  
  93. Err_cmdPrint_Click:
  94.     MsgBox Err.Description
  95.     Resume Exit_cmdPrint_Click
  96.  
  97. End Sub
  98.  
  99.  
  100.  
  101. Private Sub Command17_Click()
  102.  
  103. DoCmd.OpenReport "rptOwners_Labels_FH_P2", acViewPreview
  104. DoCmd.RunMacro "mrToolbar.ShowPrintTool"
  105. End Sub
  106.  
  107. Private Sub Command18_Click()
  108.  
  109. DoCmd.OpenReport "rptOwners_Labels_FH_P1", acViewPreview
  110. DoCmd.RunMacro "mrToolbar.ShowPrintTool"
  111. End Sub
  112.  
  113. Private Sub Form_Open(Cancel As Integer)
  114. On Error GoTo Err_Form_Open
  115.  
  116. DoCmd.Maximize
  117.  
  118. Me.cboFlat.Visible = False
  119. Me.cboProperty.Visible = False
  120. Me.cboYear.Visible = False
  121. Me.cboHalfYear.Visible = False
  122.  
  123. Exit_Form_Open:
  124.     Exit Sub
  125.  
  126. Err_Form_Open:
  127.     MsgBox Err.Description
  128.     Resume Exit_Form_Open
  129.  
  130. End Sub
  131.  
  132. Private Sub lstReports_Click()
  133.  
  134. If Me.lstReports = "rptContactProperty" Or Me.lstReports = "rptBillExtraInvoice" Then
  135.     Me.cboFlat.Visible = True
  136.     Me.cboProperty.Visible = True
  137. Else
  138.     Me.cboFlat.Visible = False
  139.     Me.cboProperty.Visible = False
  140. End If
  141.  
  142. If Me.lstReports = "rptInvoiceArrears" Or Me.lstReports = "rptPropertyActions" Or Me.lstReports = "rptInvoiceDetails" Or Me.lstReports = "rptOwners" Or Me.lstReports = "rptInvoice_Phase2" Then
  143.     Me.cboProperty.Visible = True
  144. End If
  145.  
  146. If Me.lstReports = "rptInvoice" Or Me.lstReports = "rptInvoiceRedecWindows" Or Me.lstReports = "rptInvoiceRedecoration" Then
  147.     Me.cboProperty.Visible = True
  148.     Me.cboYear.Visible = True
  149. Else
  150.     Me.cboYear.Visible = False
  151. End If
  152.  
  153. If Me.lstReports = "rptInvoiceReprint" Then
  154.     Me.cboFlat.Visible = True
  155.     Me.cboProperty.Visible = True
  156.     Me.cboYear.Visible = True
  157. Else
  158.     'Me.cboYear.Visible = False
  159. End If
  160.  
  161. If Me.lstReports = "rptGroundRentInvoice" Or Me.lstReports = "rptGroundRentArrears" Then
  162.     Me.cboHalfYear.Visible = True
  163.     Me.lblHalfYear.Visible = True
  164.     Me.cboYear.Visible = True
  165. Else
  166.     Me.cboHalfYear.Visible = False
  167.     Me.lblHalfYear.Visible = False
  168.     Me.cboYear.Visible = False
  169. End If
  170.  
  171. End Sub
  172.  
Thank you for your help in this matter. I am not a experienced programmer, I try an learn as I go along.
May 21 '07 #3

Denburt
Expert 100+
P: 1,356
The code appears to be o.k. from what I can see. When you get the error message is there a button called "debug" if so click this and tell us what line it is on.
'User-Defined type not defined'

FYI, I know your version is 2000 but have heard that MS Access 2007 is much more restrictive in the syntax department than previous versions. Although many people disagree for one reason or another the correct way to refer to a control is Me!ControlName. Me.Controlname can be quite quirky I have found this to be an issue for me in the past with older versions of Access. Just an idea.

According to Microsoft one thing MS Access will not like in Access 2007 is if you use a boolean as such.

If myBool then

Microsoft states that in 2007 you will need the complete statement.

If myBool = True then
May 21 '07 #4

ADezii
Expert 5K+
P: 8,619
I installed Office 2000 Professional onto a Windows Vista laptop and when I tried to compile the code the following error message appears:

'User-Defined type not defined'

I went to check the registry and the following message appears:

'Error accessing the system registry'.

I have tied to repair Access using the Office 2000 repair facility but no luck.

Do you have any suggestions on this problem.

Thank you
  1. The Style and Response Variables are Declared as String which is incorrect, they shoud be declared as Integers, namely:
    Expand|Select|Wrap|Line Numbers
    1. Dim Msg As String, Msg2 As String, Response As String, Style As String
    2.                                'SHOULD BE
    3. Dim Msg As String, Msg2 As String, Response As Integer, Style As Integer
    4.  
  2. GoTo Line Number, except in Error Trapping, is usually never a good idea to use. It is only supported for backward compatibility and may not even be supported in 2007. Check on this.
May 22 '07 #5

P: 3
Thank you for your prompt reply,

The problem is on a friend's laptop and I do not have access to it this week. From memory when I ran compile the error starts on the first DIM statement.

When I select Tools/References in the Microsoft Visual Basic window the

"Error accessing the system registry" message appears.

The database runs fine on my XP laptop.

I hope this is of help.
May 22 '07 #6

Denburt
Expert 100+
P: 1,356
It is als nevera goog idea to use a single word for variables you might find yourself bumpininto keywords especially since they can change from version to version.

instead of:
Dim Msg As String, Msg2 As String, Response As Integer, Style As Integer

I would use:
Dim Msg As String, Msg2 As String, intResponse As Integer, strStyle As Integer
May 29 '07 #7

missinglinq
Expert 2.5K+
P: 3,532
You might want to look at this forum's posting regarding Vista and Access databases!

http://www.thescripts.com/forum/thread653390.html
May 29 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.