Want error message when switchboard macro fails

  • Thread starter Ann Scharpf via AccessMonster.com
  • Start date
A

Ann Scharpf via AccessMonster.com

I am running Access 2003. I have created macro to import data. When I run
the macro from the macro tab, it displays an error if the import fails.
However, when I run the macro from a switchboard, I don’t get any error if
the import fails. I tried to add a line to the beginning of the macro to set
warnings on. This had no effect. I've searched help as well as the
newsgroups and can't figure out what I'm doing wrong. Can anyone please
advise me on how to get the switchboard macro to display a message if the
import fails?
As always, thanks for your help.
 
M

[MVP] S.Clark

1. What does it mean for the Import to fail?
2. Is there code in the 'switchboard' that traps errors, maybe silently
suppressing it. e.g. On Error Resume Next
3. What does it mean for the Import to be successful? Are there records in a
certain table? Can you check the population of this table to determine
Success/failure?
 
A

Ann Scharpf via AccessMonster.com

1. If the import fails, it means the user has made a typo when naming the
data transfer file in the export software system. (This database is meant to
be emptied out and reused about 20 times per day. It produces validation
reports for employees who create batch program schedules.)

2. This is my first switchboard and I didn't even know you could do anything
like "On Error Resume Next." Unless that's a default setting, I don't have
it.

3. If the import is successful, there are records in the ONLY table in the
database.

When I run the macro "standalone" from the macro tab, if the filename is
spelled wrong I get the message "The Microsoft Jet database engine could not
find the object 'ScheduleImport.txt'. Make sure the object exists and that
you spell its name and the path name correctly."

I would like to get this message – or any message – to appear if the import
fails.

Thanks for your help.

Ann Scharpf

[MVP] S.Clark said:
1. What does it mean for the Import to fail?
2. Is there code in the 'switchboard' that traps errors, maybe silently
suppressing it. e.g. On Error Resume Next
3. What does it mean for the Import to be successful? Are there records in a
certain table? Can you check the population of this table to determine
Success/failure?
I am running Access 2003. I have created macro to import data. When I run
the macro from the macro tab, it displays an error if the import fails.
[quoted text clipped - 6 lines]
import fails?
As always, thanks for your help.
 
A

Ann Scharpf via AccessMonster.com

I should add that there is about zero possibility that the import will fail
because of a data problem. The system that creates the data transfer file
has never (to my knowledge) produced a file with anomolies that would cause
an import failure.

Ann said:
1. If the import fails, it means the user has made a typo when naming the
data transfer file in the export software system. (This database is meant to
be emptied out and reused about 20 times per day. It produces validation
reports for employees who create batch program schedules.)

2. This is my first switchboard and I didn't even know you could do anything
like "On Error Resume Next." Unless that's a default setting, I don't have
it.

3. If the import is successful, there are records in the ONLY table in the
database.

When I run the macro "standalone" from the macro tab, if the filename is
spelled wrong I get the message "The Microsoft Jet database engine could not
find the object 'ScheduleImport.txt'. Make sure the object exists and that
you spell its name and the path name correctly."

I would like to get this message – or any message – to appear if the import
fails.

Thanks for your help.

Ann Scharpf
1. What does it mean for the Import to fail?
2. Is there code in the 'switchboard' that traps errors, maybe silently
[quoted text clipped - 8 lines]
 

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

Top