Overcoming an Error Message Q

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

I have a piece of code that extracts information from an access
database, everthing works well and I use this common file across
various locations. My problem is that a "cannot connect to database"
dialog box appears for a certain location. I know why this is, becase
it doesn't have the relevant access database. Thats okay, I don't need
it, but how could I 'ignore' this error when this error appears and
continue to run the remaining piece of code?

Thanks
 
you could try Application.DisplayAlerts = False at the beginning of your
code, and Application.DisplayAlerts = True at the end.
 
Nah, doesn't work

The specific message is "ODBC Microsoft Access Driver Login Failed",
it gives an OK/Cancel option and I have to keep clicking Cancel to
move forward

Was hoping that if any error dialog message appeared just ignore and
continue 'actioning' code
 
Hi,

Can you not add:

On Error Resume Next

on the line before the line where the error appears and then:

On Error Goto 0

(or to wherever your errors were going before) on the line after?

If this works then a better solution would be to test the error value so
that you only ignore the error if it is for this specific reason, then if any
other error occurs an error message will still appear.

Hope this helps,

Sean.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top