Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Unanswered: dao delete field method through vb

    Hi,

    can anyone help me? I'm trying to delete fields programmatically using the following method:

    With qdf
    .Fields.Delete "field1"
    .Fields.Delete "field2"
    end with

    But keep getting "method not applicaable for this object" error when I run the code.

    What I'm doing is importing an excel spreadsheet which has 4-5 fields between the actual data I need so i'm trying to remove them after the import is complete.

    The other option is to import multiple ranges.

    Any ideas?

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    I assume that qry is a QueryDef object collection ??

    If so, I think you want a TabeDef collection not a QueryDef collection ie

    With TableDef
    .Fields.Delete "field1"
    .Fields.Delete "field2"
    end with


    Does that help?


    MTB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •