Results 1 to 4 of 4
  1. #1
    jeffatwork is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2016
    Posts
    3

    Create a field, if it doesn't already exist

    I'm attempting, via vba, to check if a field exists, if it doesn't, then create it. I have a handful of fields to apply this to. Any help is appreciated.

    Thanks

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    if you are want to fill in records on a form try looking at a if statement. http://www.techonthenet.com/access/f...ed/if_then.php
    something like
    if isnull(txtone) or len(txtone)=0 then
    txtone="happy"
    end if

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    it is unclear whether you wish to create a new field in a table or a new text control box on a form or both. but in any case the rationale to do this via vba on-the-fly is a stretch and definitely not something that is common.... perhaps it would be best if you explain the goal in more general terms as perhaps you have a fundamental design issue at play here...

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    jeffatwork,

    Please tell readers why you would be adding fields via vba.
    Perhaps you could give us some overview of your background/experience with database and access.

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

Similar Threads

  1. record doesn't exist
    By slimjen in forum Forms
    Replies: 7
    Last Post: 08-13-2014, 11:07 AM
  2. Replies: 19
    Last Post: 08-08-2013, 01:17 PM
  3. VBA to create PDF and folder if doesn't exist!
    By crxftw in forum Programming
    Replies: 2
    Last Post: 08-08-2011, 08:53 AM
  4. Append if record doesn't exist
    By Lorlai in forum Queries
    Replies: 1
    Last Post: 06-14-2011, 06:38 PM
  5. Form doesn't exist
    By Back2Basics in forum Access
    Replies: 1
    Last Post: 02-01-2010, 11:39 AM

Tags for this Thread

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