Unable to compact a database - TechRepublic
Question
May 23, 2008 at 02:13 PM
jordan1

Unable to compact a database

by jordan1 . Updated 17 years ago

Hello, around September of of 2007 I inherited a database to maintain. Ever since I started I was unable to compact the database I keep getting the error message “Records can’t be read, no read permission.” I found some code in one of the forms that I think may be the culprit. Would you please read and let me know if and what I can try to edit this code. I do have the password to get in and it does enable me to write data but doesn’t allow me to compact when logged in under the user mentioned in the code below. Thank you so much I understand if you cannot help.

Private Sub Part_description_DblClick(Cancel As Integer)

If DBEngine.Workspaces(0).UserName = “Gatekeeper” Then
DoCmd.RunMacro “CR’s.Change request”

ElseIf DraftValue = “yes” Then
DoCmd.RunMacro “CR’s.Change request”
Else
DoCmd.RunMacro “CR’s.Change request RO”
End If
Dim stDocName As String
stDocName = “Change requests”
DoCmd.OpenForm stDocName, , , [Number] = [Forms]![Cr’s pick list all]![Number], acFormReadOnly

End Sub

This discussion is locked

All Comments