FILE ALREADY IN USE

VKKT
2StarLounger
Posts: 184
Joined: 13 Jun 2018, 07:50

FILE ALREADY IN USE

Post by VKKT »

Happy new year to All,

While trying to open my Access DB, I am getting the message that "the file already in use". This file open with a username/password, below is the code used. Is it due any thing wrong in the code. this code I am using for long time.

Code: Select all

Private Sub Command4_Click()
'Dim UserLeve As Integer
Dim dbPassword As String
If IsNull(Me.UserID) Then
    MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"
    Me.UserID.SetFocus
ElseIf IsNull(Me.PWord) Then
    MsgBox "Please Enter Password", vbInformation, "Password Required"
    Me.PWord.SetFocus
Else
    'Process the Job
If (IsNull(DLookup("UserLogIn", "tblUser", "UserLogIn ='" & Me.UserID.Value & "'"))) Then

MsgBox "Incorrect username"

ElseIf (Me.PWord.Value <> DLookup("Password", "tblUser", "UserLogIn ='" & Me.UserID.Value & "'")) Then
MsgBox "Incorrect password entered"

Else
    UserLevel = DLookup("UserSecurity", "tblUser", "UserLogIn ='" & Me.UserID.Value & "'")
    DoCmd.Close
    If UserLevel = "Admin" Then
      DoCmd.OpenForm "Navigation FORM"
ElseIf UserLevel = "Admin1" Then
    DoCmd.OpenForm "Navigation FORM-Admin"

    End If
    End If
    End If
   
  End Sub
How to solve this issue.

Regards,
VKKT
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78241
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: FILE ALREADY IN USE

Post by HansV »

Best wishes,
Hans

VKKT
2StarLounger
Posts: 184
Joined: 13 Jun 2018, 07:50

Re: FILE ALREADY IN USE

Post by VKKT »

Thanks,

Cannot even copy the file from the folder.

I am using MS office 19. Any other option to get the data from the file

regards,
vkkt

User avatar
HansV
Administrator
Posts: 78241
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: FILE ALREADY IN USE

Post by HansV »

If you are sure that nobody else is using the database, check if there is a file in the same folder as the database and with the same name but extension .laccdb instead of .accdb. If there is, try deleting the .laccdb fie.
If that doesn't help, and if the problem persists after restarting your computer, try Unlocker, a free utility that removes file blocks.
Best wishes,
Hans

VKKT
2StarLounger
Posts: 184
Joined: 13 Jun 2018, 07:50

Re: FILE ALREADY IN USE

Post by VKKT »

Thanks Hans,

No one opened the file, there is no .laccddb file in folder. this is in network drive which is using by more than 35 people. first time this problem came since the start in 2019. the unlocker is blocked in my company system.

Thanks
VKKT

User avatar
HansV
Administrator
Posts: 78241
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: FILE ALREADY IN USE

Post by HansV »

If restarting your computer doesn't help, I'm out of ideas. Sorry!
Best wishes,
Hans

VKKT
2StarLounger
Posts: 184
Joined: 13 Jun 2018, 07:50

Re: FILE ALREADY IN USE

Post by VKKT »

HI,
Now it is opening, thank God, otherwise I would have lost the whole data.
Thanks for your time Hans.
regards,
vkkt

User avatar
HansV
Administrator
Posts: 78241
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: FILE ALREADY IN USE

Post by HansV »

Phew!
Best wishes,
Hans