VBA code works on one machine but not another?

ali37

Registered User.
Local time
Today, 01:10
Joined
Jul 3, 2013
Messages
10
hi there, i have this vba code which allows the user, through the use of a macro, create a folder within a certain directory using the unique ID number of the record as the folder name. It will not create duplicates. This works great on one pc but not another, which has the same directory available to it (the database and the folders created are stored on a shared drive within the network) also the computers are running the same version of Access so im not sure what the issue may be, please help!

here is the code used:

Private Sub MCRfolder_Click()
Dim strPath As String

strPath = "Z:\AMSS Database\Learner Certificates PDF\" & Me.txtLearnerID
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
Shell "explorer.exe " & strPath, vbNormalFocus

End Sub
 
Last edited:
What exactly do you mean by It does not work? Does it throw an Error? Does it not create a Directory? What is not happening?
 
couple of things to check:
do the users have the same network permissions, try letting the OK user log on to the machine that is failing
do the pc's have the same O/S
are they both running exactly the same .mdb file

David
 
sorry it throws up an error involving the vba code, then brings up the troubleshooting error for the code, but does not specify or highlight where the problem is
 
So it does throw an Error.. What is the exact error? Did you try compiling the code?
 

Users who are viewing this thread

Back
Top Bottom