• Changing field type

    Author
    Topic
    #467988

    I am trying to do some automation for a database.
    I current import a file from another system.
    My numeric fields come in as text.
    I normally just on the table design and change them manually.
    I am trying to automate this process because I am passing the database to someone else to use.
    Is there a macro function to change a field type or a query to change a field type and then make a table???

    Thanks,
    Deb

    Viewing 1 reply thread
    Author
    Replies
    • #1217174

      Yes it is possible to do what you describe – although it means you need use DAO to manipulate the TableDef object for the table in order to change it. The subject is a bit more than can be easily handled in the forum, but DAO Tabledef (MFC) is a place you could start. If you have some comfort level with VBA and DAO, you should be able to do what you want. If you want to see examples and code, the Access VBA Programming books from WROX have some examples with detailed descriptions. And you might find Allen Browne’s tip on the subject useful.

    • #1217211

      I am trying to do some automation for a database.
      I current import a file from another system.
      My numeric fields come in as text.
      I normally just on the table design and change them manually.
      I am trying to automate this process because I am passing the database to someone else to use.
      Is there a macro function to change a field type or a query to change a field type and then make a table???

      Thanks,
      Deb

      Why dont you import the table into the database like you do now.

      Then create an append query to append records from that table to another table (after having deleted all records from that table first) where those text fields have already been defined as numeric.

    Viewing 1 reply thread
    Reply To: Changing field type

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: