Access shortcut Executable path

and when i removed the quotes the shortcut is getting created when i looked in to target property it is just storing access executable path and error is getting displayed like unrecognized format
 
and when i removed the quotes the shortcut is getting created when i looked in to target property it is just storing access executable path and error is getting displayed like unrecognized format

You might have to play around with the quotes to get them just right.

Use a breakpoint and the Debug.Print feature to print out the resulting string in your IMMEDIATE WINDOW in the VBA area so you can see what it is coming out with before letting it continue. If it is wrong just stop the code and then try fixing it again and continue, etc.
 
how do you do that i mean debug.print .... what should i specify after print
 
You put it just after the place where workfield is built with the concatenation and it is like this:

Debug.Print workfield
 
Hi SOS,


It is a quickie , DO you know how to move a file from one folder to another folder through vba .
I know FileCopy("Current Path", "New Path") . But it isn't working . DO you know that by any chance. Thank You.
 
Try this:

Name FileoneNameAndPathHere As MovedFileNameAndPath

(and this is another reason why you should never use NAME as a field name) :D
 
I will be a bit clear i need to move file which resides in program files folde ron C drive to COmmon Files folder on Cdrive.
How do i do that. Thank You.
 
Actually MOVING a file or just copying it?
 
Code:
Dim strFileFrom As String
Dim strFileTo As String
 
strFileFrom = "PathAndFileName"
strFileTo = "PathAndFileNameTo"
 
FileCopy strFileFrom, strFileTo
 
hi, its not working. I tried a few ways some times it says bad file number

some times file not found.

some times path not found.
 
You have to make sure the folder exists and the file to be copied exists.

You can use the DIR function for that (check the VBA help files for help on that).

Both the old and the new need to have the entire file name and path.

So,

FileCopy "\\MyServerName\ServerShare\FolderName\MyDoc.doc, "C:\Temp\MyDoc.doc"

etc.
 
actually let me post some code that i have it is working . but one issue actually


Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\Security Database\*.*", "C:\Sample"
 

Attachments

actually nothing

what l would like to know is that after " *.*" it copies all files in to the sample folder only files but not the sub folder if it has any.
 
I think this one might be better if you moved it to its own thread.
 
i did not get that. do you want me to delete the attachment
 
i did not get that. do you want me to delete the attachment

No, take the question about the subfolders and post in a new thread.

I don't use the filedialog much and don't iterate through folders for file maniuplations so you'll probably have a better response if you start a new thread for that question.
 
Oh Ok . But if you check it is moving the files . Don't you think so. Genuinely, Thanks a lot for having so much patience and clearing all my queries. Thank You.
 
I think this one might be better if you moved it to its own thread.

Ditto. This thread has gone off topic.

There are plenty of theads about the FileSystemObject which is used to move, copy, rename and delete files.

Searching the forum before posting usually answers most questions.
 
Bit of a zombie thread, but this'll add some value ...
Code:
CreateObject("WScript.Shell").RegRead( _
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\" & Application.Version & "\Access\InstallRoot\Path")
 

Users who are viewing this thread

Back
Top Bottom