Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2007, 11:42 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You might try this:

Private Sub cmdMkDir_Click()
    Dim newFOL As String
    Dim sToFolder As String

sToFolder = "\\resrslavingt002\u_datacentre\HRM\Projects\Exist ing Projects\0TEST0\"

    newFOL = "\\resrslavingt002\u_datacentre\MM" & " \ " & txtHrmRef & " - " & txtName & " - " & txtBenCode
    'On Error Resume Next

    Set objFSO = CreateObject("scripting.filesystemobject")
    Set objFolder = objFSO.CreateFolder("\\resrslavingt002\u_datacentr e\HRM\Projects\Existing Projects\0TEST0\")
    Set objCopyFolder = objFSO.copyfolder("\\resrslavingt002\u_datacentre\ HRM\Projects\New Project Templates\NEW HRM TEAM JOB AID\*", sToFolder, False)

End Sub


mmcdonal
 
Old January 4th, 2007, 01:35 PM
Authorized User
 
Join Date: Jan 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

no difference im afraid

 
Old January 5th, 2007, 08:47 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Just use this:

Dim objCopyFolder



mmcdonal
 
Old January 5th, 2007, 09:07 AM
Authorized User
 
Join Date: Jan 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mary
That causes a error "object required" i think i will just leave it with the "error resume" as it is doing all that i need it to.

Another question - When i create a folder, it takes info from 3 different fields if all the fields are not filled in then i cannot delete that folder in explorer it tells me that "cannot read from source file or disk", all three fields are not required to be filled out.

any ideas?
thanks for your help so far.

 
Old January 5th, 2007, 09:19 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Check the values first:


Dim txtHrmRef, txtName, txtBenCode As String
(I am not sure where you are getting the data)

If IsNull(txtHrmRef) Or txtHrmRef = "" Then
   txtHrmRef = "-" ' or some other value
End If

etc

newFOL = "\\resrslavingt002\u_datacentre\MM" & " \ " & txtHrmRef & " - " & txtName & " - " & txtBenCode

This allows you to substitute a value for the string if it is empty or null.

HTH

mmcdonal
 
Old January 5th, 2007, 01:57 PM
Authorized User
 
Join Date: Jan 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i will try that, just to say i really appreciate all your expertise on this,
have a nice weekend
Jonni






Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating folders on network share JonniP Access VBA 1 January 3rd, 2007 03:51 PM
running ROBOCOPY on network share? froztbyte Classic ASP Professional 0 September 28th, 2006 08:26 PM
Accessing 2 Access Databases using VBA mays0515 Access VBA 3 August 4th, 2005 12:58 PM
Use VBA to get data from Access (Share folder) ckentebe Access 6 April 28th, 2004 10:09 PM
Use VBA to get data from Access (Share folder) ckentebe Access 1 April 21st, 2004 06:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.