var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Map network drive
From a command window I can type
and map the given path to the s:\ drive. How can i do this from VBA?
net use s: /delete
net use s: \\myComp\myDir
I'm looking at that now. Having a little trouble converting to VBA.
For the given code, VBA is expecting an "=" sign.
Set wshnetwork = CreateObject("WScript.Network")
Last edited by campster; 04-11-06 at
Got it but I'm a little confused.
The question I have is: why do some functions require parenthesis and some crash if parenthesis are used?
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "z:", "\\myComp\myDir"
The difference is a Function versus a Sub. When you call a function you use the parenthesis and it is assumed that a value will be returned. Where as, a Sub does not return anything and no parenthesis are required. Example
strSomething = SomeFunction(Parameter1, Parameter2)
SomeSub Parameter1, Parameter2
It is also acceptable to call a sub with parenthesis but you have to use the Call keyword (I use this in the Immediate window of the editor to test a sub)
The Call informs Access that no value will be returned.
Thanks for the explanation. Now I'll see if my pea brain will be able to remember it for more than a day.