BIRD_FAT
05-04-2009, 11:48 PM
(Differences Noted in RED)
Can anyone tell me why if I use this code:
Private Sub OpenIAG_Click()
On Error GoTo Err_OpenIAG_Click
Dim stAppName As String
stAppName = "explorer.exe " & "M:\Student_Files\My_Students\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "_-_IAG.xls"
Call Shell(stAppName, 1)
Exit_OpenIAG_Click:
Exit Sub
Err_OpenIAG_Click:
MsgBox Err.Description
Resume Exit_OpenIAG_Click
End Subto call a file (M:\Student_Files\My Students\Stephen Jones\Stephen Jones - IAG.xls) I get a dialogue box asking if I want to open, save or cancel; yet if I use this code
Private Sub OpenIAG_Click()
On Error GoTo Err_OpenIAG_Click
Dim stAppName As String
stAppName = "excel.exe " & "M:\Student_Files\My_Students\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "_-_IAG.xls"
Call Shell(stAppName, 1)
Exit_OpenIAG_Click:
Exit Sub
Err_OpenIAG_Click:
MsgBox Err.Description
Resume Exit_OpenIAG_Click
End SubI get the message:
'M;\Student_Files\My_Students\Stephen_Jones\Stephen_Jones_-_IAG.xls' could not be found.
And if I remove the Underscores the message is similar but is broken at every space giving me 7 error messages.
Any ideas, folks?!
Cross posted here (http://www.access-programmers.co.uk/forums/forumdisplay.php?f=9)
Can anyone tell me why if I use this code:
Private Sub OpenIAG_Click()
On Error GoTo Err_OpenIAG_Click
Dim stAppName As String
stAppName = "explorer.exe " & "M:\Student_Files\My_Students\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "_-_IAG.xls"
Call Shell(stAppName, 1)
Exit_OpenIAG_Click:
Exit Sub
Err_OpenIAG_Click:
MsgBox Err.Description
Resume Exit_OpenIAG_Click
End Subto call a file (M:\Student_Files\My Students\Stephen Jones\Stephen Jones - IAG.xls) I get a dialogue box asking if I want to open, save or cancel; yet if I use this code
Private Sub OpenIAG_Click()
On Error GoTo Err_OpenIAG_Click
Dim stAppName As String
stAppName = "excel.exe " & "M:\Student_Files\My_Students\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "\" & Forms!FrmStudentTracking.Form.Forename.Value & "_" & Forms!FrmStudentTracking.Form.Surname.Value & "_-_IAG.xls"
Call Shell(stAppName, 1)
Exit_OpenIAG_Click:
Exit Sub
Err_OpenIAG_Click:
MsgBox Err.Description
Resume Exit_OpenIAG_Click
End SubI get the message:
'M;\Student_Files\My_Students\Stephen_Jones\Stephen_Jones_-_IAG.xls' could not be found.
And if I remove the Underscores the message is similar but is broken at every space giving me 7 error messages.
Any ideas, folks?!
Cross posted here (http://www.access-programmers.co.uk/forums/forumdisplay.php?f=9)