|
-
Jun 29th, 2006, 07:10 AM
#1
Thread Starter
New Member
VB script in Acces
Please help me out...
On a network share I have pictures of employees. Name of picture is "<employeenumber>.gif".
In Access I have a table containing employeenumber, full name etc.
I like to have a query verify if every employee has it's own picture (why? Because it is used on an intranet). The output should contain the employeenumber and full name of persons without a picture.
Now I tried something with:
test: Len(([Dir$](('O:\picture\') & [employeenumber] & ('.gif')))).
where "O:\picture" is the share on the network which contains the images and "employeenumber" is a field in a table.
But this isn't working.
What am I doing wrong?
-
Jun 29th, 2006, 11:50 AM
#2
Re: VB script in Acces
VB Code:
Len(Dir("O:\picture\" & [employeenumber] & ".gif"))
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 30th, 2006, 09:46 AM
#3
Thread Starter
New Member
Re: VB script in Acces
Thanks for the reply,
I tried the suggested line, but now I get an error:
Undefined function Dir.
-
Jun 30th, 2006, 09:49 AM
#4
Re: VB script in Acces
where are you calling this???
right in a Query?
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 30th, 2006, 10:00 AM
#5
Re: VB script in Acces
ok.. well I guess u cant call dir in a query.. solution
open a module and drop this in:
VB Code:
Public Function FileExists(sFile As String) As Boolean
If Len(Dir(sFile)) <> 0 Then
FileExists = True
End If
End Function
the u call it like this...
FileExists("O:\picture\" & [employeenumber] & ".gif")
it will return -1 if its there 0 if not...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 7th, 2006, 03:59 AM
#6
Thread Starter
New Member
Re: VB script in Acces
Yes,
This one worked.
Thank you very much for assisting me.
-
Jul 7th, 2006, 01:45 PM
#7
Re: VB script in Acces
youre welcome
please... click on thread tools > mark thread resolved. that way others know u have your answer. Thanks!
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|