Recent content by thh

  1. T

    Delete fields referring to field number

    Good point about the index, llkhoutx. Otherwise it seems that the trick is to pull out the field name in a loop, and input the fieldname in the delete statement: Sub DeleteFields() 'Make a copy of table for testing: DoCmd.CopyObject , "MyTableCopy", acTable, "MyTable" Dim db As...
  2. T

    Delete fields referring to field number

    I need to trim a lot of tables. Is it possible to delete table fields with reference to the field number instead of field name? The command 'tblMyTable.Fields.Delete ("FieldName")' takes a string (field name) as input. I rather like to - in a loop - delete say, Sub DeleteFields() For i =...
  3. T

    Compare field names, adding/deleting fields

    Thanks boblarson Yes, a properly normalized database will probably ensure that I do not end up with such "ugly" tables like my Table B (having to rely on a Pivot query) that needs restructuring. As things are in my field (economic research), we are often given badly structured databases from...
  4. T

    Compare field names, adding/deleting fields

    Problem: Field names in my table A is built by a character followed by a number, e.g. A1, where 'A' signies the variable and '1' an ID of a person. My second table B have the same field name structure, like B1, B3 etc. This table is constructed as a result of a complex Pivot query, and I have...
  5. T

    generate a table from a sql string VBA

    You want to dump the record set from a query into a table. Normally, a make-table query is used for this operation. But in the case of a complex TRANSFORM ... PIVOT query, a two step procedure will do the trick. Elaborating on the point of Bat17: I will suggest: Step 1: Create the complex...
Back
Top Bottom