Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old January 4th, 2007, 11:42 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #12 (permalink)  
Old January 4th, 2007, 01:35 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

no difference im afraid

Reply With Quote
  #13 (permalink)  
Old January 5th, 2007, 08:47 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Just use this:

Dim objCopyFolder



mmcdonal
Reply With Quote
  #14 (permalink)  
Old January 5th, 2007, 09:07 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
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.

Reply With Quote
  #15 (permalink)  
Old January 5th, 2007, 09:19 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #16 (permalink)  
Old January 5th, 2007, 01:57 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:28 PM.


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