|
-
May 22nd, 2007, 08:06 AM
#1
Thread Starter
Member
Coding for pull-down menu
I have coding behind a pull-down menu which finds and displays a drawing which is actually an adobe pdf file which has been saved in a particular folder.
The code runs well and finds the drawing which is named with a Job Number followed by -DWG for example 222555-1-DWG for first drawing and 222555-2-DWG for second drawing. The 222555 is the Job Number and is taken from the textbox, named txtJobNo from the current record of the form.
When I click on Drawings in the pull down menu I would like to display a list of one or more drawings found in the folder and then be able to open each one from the list. The code I have at the moment automatically opens the first drawing found only...
Private Sub mnuDrawings_Click()
'Pulldown Menu to display Drawing/s
Dim Path As String, dwgFile As String, JobNo As String
JobNo = txtJobNo.Text
Path = "C:\JobsFolder\" & JobNo & "\"
dwgFile = JobNo & "-" & "DWG.pdf"
'Requires reference to Microsoft Scripting Runtime to use the FileSystemObject.
With New FileSystemObject
If .FileExists(Path & dwgFile) Then
ExecuteWait Path & dwgFile
Else
MsgBox "File " & Path & dwgFile & " does not exist."
End If
End With
End Sub
Any help is much appreciated!
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
|