Refering to Network Drives

M

Molasses26

I have an application that I want to distribute to people on our company
network and I have some pictures that I want to embed on the main menu screen
that will change each month. I have entered the code below in the Open event
of the form but when I try to open the form I get a "Run-time error 2220
Can't open file ..." message and the form won't open. However if I comment
out this code and set the picture property of the form directly to
"\\myserver\mydir\myart\August.wmf" it works just fine. Why won't it accept
this same syntax in the VB code?

Private Sub Form_Open(Cancel As Integer)
Select Case Month(Now)
Case 1
Me.Picture = "\\myserver\mydir\myart\January.WMF"
Case 2
Me.Picture = "\\myserver\mydir\myartFebruary.WMF"
Case 3
Me.Picture = "\\myserver\mydir\myart\March.WMF"
Case 4
Me.Picture = "\\myserver\mydir\myart\April.WMF"
Case 5
Me.Picture = "\\myserver\mydir\myart\May.WMF"
Case 6
Me.Picture = "\\myserver\mydir\myart\June.WMF"
Case 7
Me.Picture = "\\myserver\mydir\myart\July.WMF"
Case 8
Me.Picture = "\\myserver\mydir\myart\August.WMF"
Case 9
Me.Picture = "\\myserver\mydir\myart\September.WMF"
Case 10
Me.Picture = "\\myserver\mydir\myart\October.WMF"
Case 11
Me.Picture = "\\myserver\mydir\myart\November.WMF"
Case 12
Me.Picture = "\\myserver\mydir\myart\December.WMF"
End Select
DoCmd.Maximize
End Sub
 
Top