Search results

  1. W

    Passing Errors from Functions to Containing Sub

    After I posted my question, I discovered the Raise.Err method, and I found that the following works at passing the error to the calling sub: ErrorHandler: Call Err.Raise(Err.Number) Exit Function But you have added a helpful suggestion that helps identify the code in which the error...
  2. W

    Passing Errors from Functions to Containing Sub

    I'm using MS Access 2003. This is probably a bonehead question, but I've been googling for a while with little success. I have some validation code that I'd like to make into a function because the code will be used in multiple places. I'm thinking that if an error happens in the validation...
  3. W

    Import Empty Strings from CSV?

    Yes, I had thought of that, but it would be a lot cleaner if I could do it during the import.
  4. W

    Import Empty Strings from CSV?

    I'm using Access 2003. If I import a CSV file where every field is wrapped in double quotes, an empty string in the CSV imports as a NULL in the target table. Is there any way for that column to import as an empty string instead? I don't see anything in the import specification screen that...
  5. W

    Adding Header & Trailer Records to TransferText Exports

    I'm using MS Access 2003. I have code that exports the results of a query to CSV file using DoCmd.TransferText. However, since this export file will be used in an EDI transmission, I also need to prepend header records and append trailer records to the extract. Can/should this be done within...
  6. W

    Returning a Query's RecordCount to VBA

    I'm using Access 2003. Probably a bonehead question here: How can I run a query within VBA and capture the recordcount of the result set? I'd like to use the CurrentDb.Execute function, but it seems to work only for "action" type queries (Inserts, Updates, or Deletes). Thanks for any help...
  7. W

    How to Get Access to Move a File in the File System

    On a related note, ... Is it possible to use the Name command to move the file using from and to locations *relative* to the MDB or MDE file that is running (rather than an absolute reference)? I'd like to make it so that I can move the entire directory structure that contains the MDB...
  8. W

    How to Get Access to Move a File in the File System

    Wow! That's awesome. Thanks, Bob.
  9. W

    How to Get Access to Move a File in the File System

    I'm using Access 2003. I have VBA code that imports a CSV file into an Access temp table. After the import, I'd like Access to move the CSV file into a "Processed" folder so the end user doesn't try to import it again. I've googled on this, but there seem to be a bunch of different...
  10. W

    Trapping Errors for Duplicate Index

    I don't believe that's the problem. If I add a breakpoint in the Form_Error event, it never reaches that breakpoint. In the code I previously posted, the ErrorHandler section does indeed execute when this error happens. But I just get the "Microsoft Visual Basic" dialog that says "Run-time...
  11. W

    Trapping Errors for Duplicate Index

    Hi, Sorry, I thought that there was perhaps a different approach that was required by this type of error. The relevant code is below. It fails on step #4 where it tries to run qryLoadLiaSourceDetail, which inserts records into a table having an indexed column that allows no duplicates...
  12. W

    Trapping Errors for Duplicate Index

    I'm using MS Access 2003. I have a subroutine with the following statement at the top: OnError GoTo ErrorHandler along with the corresponding :ErrorHandler section at the bottom. I also have a table with a column that is indexed with No Duplicates. I notice that if Access encounters a...
  13. W

    Using TransferText to Import a File Specified in a Textbox

    That resolved it! Thanks very much. Wayne
  14. W

    Using TransferText to Import a File Specified in a Textbox

    I'm using MS Access 2003. I'm have a form on which the user clicks a Browse button to select a file to be imported into Access. If I use the following syntax to do the import, I receive a run-time error "Type mismatch": DoCmd.TransferText acImportDelim, "LiaImportSpecification"...
  15. W

    MS Access 2003 Import Filename Limitations?

    I'm using Access 2003. I have a TransferText command that works fine, as follows: DoCmd.TransferText acImportDelim, "LiaImportSpecification", "tblLiaSourceImport", "H:\SmartSoft\SsLogistics\CSVInput\lia.csv", False However, if I copy the lia.csv file as LIA.20120819.211726.csv and...
  16. W

    Question Inserting Field into Import Specification

    Perhaps you're using a different version of Access. If, while creating the spec, I forget a field, I see no way to insert it between two existing ones. (I'm trying to do this looking at the form as in the attached.) No problem if it's a small table, but if it has 100 columns and I forget...
  17. W

    Question Inserting Field into Import Specification

    I'm using Access 2003. Probably a dumb question, but if I create an Import Specification, how do I add an extra field in the middle of the field list? All I can see to do is re-enter all fields from the new field downward. Thanks for any help you can give. Wayne
  18. W

    How Often Is Now() Calculated During a Query?

    Thanks, John. That's kinda what I suspected, but I couldn't find anything in the Access Help. Wayne
  19. W

    How Often Is Now() Calculated During a Query?

    I'm using MS Access 2003. I'm wondering whether Now() gets calculated once during a query or once for each record that it applies to. For example, consider the following query: INSERT INTO tblLiaEdiHeader ( CommunicationHeader, ImportDateTime ) SELECT DISTINCT...
  20. W

    SQL Code Reformatting Annoyance

    I'm using MS Access 2003. Not sure if this is a dumb question, but ... When I save a query in MS Access 2003, it has the annoying habit of reformatting my query. For example, if I enter and save the following code in my query screen, SELECT DISTINCT a.CommunicationHeader AS...
Back
Top Bottom