Complete table from database

  • Hi everyone,


    I'd like to do through VBA the following thing: fill-in data from a database to a template. The challenge here is that the columns names from the database and the template fields are not similar (and that cannot be changed unfortunately). I've then created a correspondance table:


    Règles de remplissage
    Catégorie formulaire -> Colonne base de données correspondante
    Numéro d'étudiant -> [ID E]
    Nom de l'étudiant -> [N.E] - [P.E]
    Degré actuel -> [CL]
    Corps d'étude -> [Spec]


    I have to create about 600 templates automatically so I don't see any other solution than VBA. Each template would then be saved in a separated folder with the student ID as a filename.


    Does anyone know how to make them correspond and fill in automatically? I did it few years ago BUT the names were the same but now I'm completely blocked...I attached the file.


    A massive thank you to anyone who will provide me support !!


    Jack

  • Hi, I'm not sure what you want to do with the end result but I created a procedure in module1 that loops through all the cells in the table and populates the relevant info based on the templaye you created (i created a "Form" sheet to work with). all it does is populates but that should be a start so you can print as pdf or save the templates each time.