Results 1 to 5 of 5
  1. #1
    Mgomp is offline Novice
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8

    Adding a field to a table with vba-code

    Hi all.



    I have a situation I need some help to fix:

    I have a Front-end which several user have a copy of, and they are all using separate Back-end files. (One Back-end for each project)

    Now, i have a situation that I have to update the front end, and I need to add a field to every back-end table. But, when that i is done, I need a check in the front end that skip this code if the field in the table are selected.

    So I need som hint how to programaticly add a field to a linked table from a front end.
    And a code hint on how to check if the field are present...

    Regards,

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I've never had to do this but I know that the TableDef Object in Access is what you'd use to achieve this.
    Try this link:
    http://www.access-programmers.co.uk/...d.php?t=174293
    . . . or Google TableDef Object.
    I hope this helps.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Could you explain these comments in more detail? This is not typical of a split, multi-user simultaneous activity database.

    a Front-end which several user have a copy of .. but not all users?

    They are all using separate Back-end files. Why?

    For adding a field (and other things) see http://allenbrowne.com/func-dao.html

  4. #4
    Mgomp is offline Novice
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8
    Orange.

    Thank you for the the link in your reply. This gives me several good ideas.

    For your questions, please excuse my lousy english writing.
    - Not all in our company need this front end - I ment to ilustrate that several persons have this front end.
    - After dealing with one back end, and the limitations of access, I fund that using one backend for each project (with average on 8 - 12000 records) is more suitable for our use.

    The question was based on the point there I would like to deploy a new front end, which - by vba - does the nessecary updates on tables.
    If I should be little fretty, the module ModifyTableDAO() in your link would be absolutly perfect in my situation if it had a check that check if the field exist befor trying to ad it. This becaus if a user opens an old backend from earlier project, the field would be added automaticly if it's missing...

    Regards,

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA code for adding records to a table
    By pwalter83 in forum Forms
    Replies: 3
    Last Post: 12-21-2011, 10:52 AM
  2. execute code on subform without adding a record
    By markjkubicki in forum Forms
    Replies: 5
    Last Post: 10-13-2011, 12:23 PM
  3. adding an autofill field from another table
    By loopyl00 in forum Access
    Replies: 3
    Last Post: 01-12-2011, 08:59 AM
  4. Replies: 3
    Last Post: 04-14-2010, 10:07 AM
  5. Adding VB code on a embedded coding for a button
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-20-2010, 12:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums