Network paths

D.Mair

David
Local time
Today, 05:26
Joined
Jun 1, 2001
Messages
33
Well this is strange

I have a combo box that lists all of the files in a folder on the server.

This works if I use
G:\Building Design\Projects\

But I need to use the UNC path

So it is
\\sac039\global$\Building Design\Projects\

This however doesn’t work, combo box comes up blank all though it looks like it has the correct number of lines in the box when I pull it down.

Any ideas what’s wrong it’s defiantly the correct path.

thanks David
 
I have allready looked at that post.

thanks anyway

the Path
\\sac039\global$\Building Design\Projects\
is correct but it is causing a problem with the combo box

thanks
David
 
I think the $ signifies something different in the share process, but I can't remember what this is. This might be causing the problem.

Then again, I might be talking absolute twaddle...
 
any other ideas?
I think we are stuck with the $ sign it is not something that IT dep would change without very good reason!

thanks
David
 
I use a UNC in on of my database apps.

I used:

Public Const Images_Path As String = "\\mts004\common\databases\Mold_Repair\Photos\"

and placed in a module. Works for me.
 
This code did work untill we moved offices and got new PC's. It recognises the path in other code.

thanks to all for the original code and to all who help modify it.

Private Sub Form_Current()
Dim Folder

Dim Year

Dim path

path = Me![Paths subform].Form![Projects]

Folder = Nz(Me![Folder])

Year = Me![qryJobYear subform].Form![Year]

If Me![Job Number] < 1999999 Then
Me![txtLongPath].BackColor = 255
Me![txtLongPath] = Null

Else

If Me![Job Number] > 2002399 Then
Me![txtLongPath] = path & Year & " Projects\" & Folder & "\Correspondence\"

Else

If Me![Job Number] > 2000000 < 2002399 Then
Me![txtLongPath] = Me![FilePath subform1].Form![File Path]

End If
End If
End If
'If Me![Job Number] < 2000000 Then
'Me![txtLongPath] = Null
'end If



Me![txtReportResult] = Nz(Me![Reference Number], "Reference Number") & ".doc"

'if file not there job number will go red
On Error GoTo Err_Form_Current
If Len(Dir$([txtLongPath] & "\.", vbDirectory)) > 0 Then
Me![txtLongPath].BackColor = 13814446

Dim I As Integer
Dim strRow As String
Dim strSearch As String
'set the search string
strSearch = Me![txtLongPath]
With Application.FileSearch
.LookIn = strSearch
.SearchSubFolders = False
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
.Execute


For I = 1 To .FoundFiles.Count
strRow = strRow & Mid(.FoundFiles(I), Len(strSearch) + 1, 500) & ";"
Next I

End With

Me.Combo6.RowSource = Left(strRow, Len(strRow) - 1)

Else
Me![txtLongPath].BackColor = 255
End If
Err_Form_Current:
Exit Sub

End Sub
 
path = Me![Paths subform].Form![Projects]

The path seems to be (hidden) on the form somewhere ....

Regards
 
Yes the path is in a subform on the main form.

The thing is this code did work!
Then when we got new pc's we got an updated image and this code no longer works!!!! IT doesn’t have a clue as to the problem, it is possibly that something on the pc that is set differently.
Any ideas what it could be?
 
If Me![Job Number] > 2000000 < 2002399 Then

After looking more at your code above line is NOT correct. it should read:
If Me![Job Number] between 2000000 and 2002399 Then
OR
If Me![Job Number] > 2000000 and Me![Job Number] < 2002399 Then

Futher you have < 1999999 and > 2000000

Jobnumbers 1999999 and 2000000 will not be handled anywhere ...

Same for >2002399 and <20023999
2002399 will not be handled

This might be (part) of your problem...

-- I hope you do indent your code, if you do try using
Code:
 when posting code. The indenting will be preserved, allowing for better reading. End the code with [ /code ] (without the spaces.

UNC paths will change on occasion when replacing computers as specially if your working with local names. Futhermore Shares might change (global$ in earlier example) or not exist at all. If the still exist under the same name, check the rights structure on the share that might have changed as well

Hope that will help you get going.

Regards

The Mailman
 

Users who are viewing this thread

Back
Top Bottom