Results 1 to 2 of 2

Thread: Adding data to a newly created field

  1. #1

    Thread Starter
    Junior Member purplegerbil's Avatar
    Join Date
    May 2006
    Location
    Bradford, Yorkshire, UK
    Posts
    23

    Unhappy Adding data to a newly created field

    Hi,

    I have used the following code to add a new field to a database. Is there a way to stop this field having a Null value but still keep it empty?

    Code:
       strSQL = "SELECT * FROM cells ORDER BY cell, Proof;"
        Set db = OpenDatabase(lblDatabase.Caption, False, False)
    
    
           Set tbl = db.TableDefs("cells")
    
            ' Create and append new Field objects
            tbl.Fields.Append tbl.CreateField("Extra", dbText, 20)

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Adding data to a newly created field

    Try
    Code:
    Dim NewField As Field
    Set NewField = NewDef.CreateField("Extra", dbText, 20)
    NewField.AllowZeroLength = False
    NewDef.Fields.Append NewField

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width