Export generating error when using a query

  • Thread starter Jim Burke in Novi
  • Start date
J

Jim Burke in Novi

I had to change an export I'm doing to use a query instead of a table because
of some formatting issues. I ran the export manually to test it, using File,
Export, etc., and it worked fine. But when I run it from a macro I get an
error message saying that one record wasn't copied due to validation rules
violations. When I compare the text file that was created manually to the one
created using the macro they have the same number of records and there
appears to be no difference. It always seems to say there's an error with one
record, regardless of the data that's being processed. As long as it's really
working it's OK, but I don't like having that error message come up every
time. Any ideas on why it does that?

When I run the macro just using the table it works fine, no error messages.
When I do the export manually, no error messages. But always the same error
message running the macro using the query in place of the table. When I ran
the export manually using the query I saved the export specs, and these are
the specs I use in the macro. I had separate specs that I saved when
exporting the table. The query is a select query, selecting every field in
the table. I had to change one of the fields to use Format(field,"00") so
that the leading zeroes on that field were kept - when exporting straight
from the table it was getting rid of my leading zero, even though it was a
text field created using Format(Field,"00").
 
J

Jim Burke in Novi

Whoops - my mistake. I had also made a coding change in a sub that runs via
the macro and that's where the error was coming from. All is working well now.
 

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