Ms Access Runtime Error 490
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up how to deal with error 490? up vote 1 down vote favorite In my access datebase i have a list of clients, each have a first name, last name, id and so on... In addition, each client has a folder (read only folder) I pre-opened for him, with files about him in it. I created a button to open that specific folder, but it keeps giving me: runtime error 490: cannot open the specified file The VB code: Private Sub Command47_Click() Dim strInput As String strInput = Forms![frmCostumer]![lName] Application.FollowHyperlink "D:\SkyDrive\klienti\strInput" End Sub The form name is frmCostumer, and the folder is named by the last name of the client (named lName). vba ms-access share|improve this question edited Jan 5 '14 at 14:43 manuell 5,80041635 asked Jan 5 '14 at 12:16 Mickey 134 Your comment "have no idea how to use VB, I just copied it from another forum" is more than enough for me to draw two conclusions: you are asking in the wrong place (minimum knowledge to ask, etc.); and your request seems a bit pointless anyway: why you ask how to deal with something in something (VB.NET) you cannot deal with?... The best way to deal with this error seems to write a proper code, what apparently you cannot deliver. –varocarbas Jan 5 '14 at 12:19 PS: VB.NE
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Runtime error 490 Cannot open specified file Want to Advertise Here? Solved Runtime error 490 Cannot open specified file Posted on 2009-09-21 MS Access 1 Verified Solution 5 Comments 1,152 Views Last Modified: 2013-11-27 I have an Access 2000 database, residing on a network. The database consists of a http://stackoverflow.com/questions/20933433/how-to-deal-with-error-490 front end and a separate back end. I store pdf files on the same server that the back end resides Using the code below, I can open the pdf files if I use the front end database on the server. However, if I try and open the pdf files from a workstation I get a Runtime error 490 Cannot open specified file. how can I resolve this? FileToView = CurrentFolder & Me.cboSelectTaxYear & "\FiledInvoices\Tax https://www.experts-exchange.com/questions/24748066/Runtime-error-490-Cannot-open-specified-file.html Invoice " & Me.lstSelectInvoice.Column(1) & ".pdf" If DoesFileExist(FileToView) = True Then Application.FollowHyperlink FileToView end if Select all Open in new window 0 Question by:TimTDP Facebook Twitter LinkedIn Google LVL 2 Best Solution byJifriz replace CurrentFolder with a ur server path ex. "\\myserver\" Go to Solution 5 Comments LVL 2 Overall: Level 2 Message Accepted Solution by:Jifriz2009-09-21 replace CurrentFolder with a ur server path ex. "\\myserver\" 0 LVL 84 Overall: Level 84 MS Access 83 Message Active today Expert Comment by:Scott McDaniel (Microsoft Access MVP - EE MVE )2009-09-21 I'd think that your file path is not correct; can you show us the code behind your "DoesFileExist" procedure, as well as the value of "FileToView" that you're passing to it? 0 Message Author Comment by:TimTDP2009-09-21 "Does file Exist" "FileToView" - will pass on tomorrow. I need to get to a networked pc Public Function DoesFileExist(ByVal strFileName As String) As Boolean Set FSO = CreateObject("Scripting.FileSystemObject") DoesFileExist = False If FSO.FileExists(strFileName) Then DoesFileExist = True End If End Function Select all Open in new window 0 LVL 14 Overall: Level 14 MS Access 14 Message Expert Comment by:ldunscombe2009-09-21 How are you setting the value of "CurrentFolder" in your code. FileToView = CurrentFolder & Me.cboSelect
a form with a linked picture. I'm trying to make a double click event to open the picture with Windows http://www.pcreview.co.uk/threads/application-hyperlink-giving-490-error.3916765/ Picture and Fax Viewer. JPG's are associated to open with that program. The code is: Private Sub PicPic_DblClick(Cancel As Integer) Application.FollowHyperlink CurrentProject.Path & "\Pics\" & [Pic_Location] & ".jpg" End Sub https://www.tutcity.com/access/custom-error-handling-run-time-error-490.47430.html I get the following error message... "Run-time error '490': Cannot open the specified file." Any ideas why? Thanks, Mark tstew, Nov 2, 2009 #1 Advertisements Jack Leach Guest ms access Application.Hyperlink defaults to opening a file as if it were clicked through a webpage (hence the hyperlink). For instance, if I open a jpg with AppHyperlink it opens in IE instead of my registered program. Use the builtin Shell() function or even better, the ShellExecute API which can be found at mvps.org/access, both of these will open the ms access runtime file using the registered application. hth -- Jack Leach www.tristatemachine.com "I haven''t failed, I''ve found ten thousand ways that don''t work." -Thomas Edison (1847-1931) "tstew" wrote: > Hello, > > I have a form with a linked picture. I'm trying to make a double click event > to open the picture with Windows Picture and Fax Viewer. JPG's are associated > to open with that program. > > The code is: > > Private Sub PicPic_DblClick(Cancel As Integer) > > Application.FollowHyperlink CurrentProject.Path & "\Pics\" & > [Pic_Location] & ".jpg" > > End Sub > > I get the following error message... > > "Run-time error '490': Cannot open the specified file." > > Any ideas why? > > Thanks, > Mark Jack Leach, Nov 2, 2009 #2 Advertisements tstew Guest Thank You, Jack. I've looked at the ShellExecute API, and that is over my head. I'm trying to use the Shell() function with the following code: Private Sub PicPic_DblClick(Cancel As Integer) If IsNull(Me.Pic_Location) Or (Me.Pic_Location) = "*No*" Then Shell (CurrentProject.Path & "\Pics\NoPicYet.jpg") Else
message to replace the "Run-Time Error '490'" error that is displayed when the database cannot find the specified file. Since I'm pretty sure that this procedure needs to be coded with the OnClick event, I'd like to create a vbOKonly message that tells users the PDF file does not exist because the criteria on the FollowHyperlink string is not met. I have a small grasp of error-handling, but I can't seem to complete the full procedure and resume normal functions (due to the VBA syntax errors I keep stumbling on Sponsored Links: Read full post... Report an issue Thank you for taking the time to report an issue. What's wrong... Please write below. And write your email address (optional) Similar posts... Implementing good error handling? My first question is: is it so that every sub routine and every function need a error handling sub? Sometimes I have only one or two lines of code, for example when clicking a button. Should it still be an error handler for that? Second, how do I use the error numbers? And finally, which is the "right" way of coding the error handling? Can I use a standard piece of code, or do every error handling need to be unique? Run time error 3101 - Error handling code on error handling.I got an error of 3101. and I know the reason for this error is that, I dont have record ID in my table. are there any code to handle this? I want the user to get prompt by a message box that the ID he/she is trying to enter is not yet in the table Error Handling in VBA Every function or sub should contain error handling. Without it, a user may be left viewing the faulty code in a full version of Access, while a run-time version just crashes. Error Handling unfamiliar with best practice programmer that I am, I'm at least familiar with the importance of error handling in my code. However, I'm unfamiliar with best practice. Currently, I error handle every sub. Like below (modeled after what comes in the sample MS Access databases for error handling). Private Sub cmbSample_AfterUpdate() On Error GoTo Err_cmbSample_AfterUpdate 'Here is a bunch of code if x then do this else end if Exit_cmbSample_Aft