Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

AllowZeroLength

hi
  i want to create a table in access 97 through vb in which i want to set field property i.e
AllowZeroLength = Yes. How can i do this?


thnxs
0
jatinderbahl
Asked:
jatinderbahl
  • 5
1 Solution
 
1WilliamCommented:
in the table properties, set AllowZeroLength to Yes
0
 
1WilliamCommented:
Take a look at help under AllowZeroLength Property
0
 
1WilliamCommented:
Sub ZeroLengthField()
     Dim dbs As Database, tdf As TableDef, fld As Field

     ' Return reference to current database.
     Set dbs = CurrentDb
     ' Return reference to Employees table.
     Set tdf = dbs.TableDefs!Employees
     ' Create new field in Employees table.
     Set fld = tdf.CreateField("SpouseName", dbText, 15)
     ' Allow zero-length strings in field.
     fld.AllowZeroLength = True
     ' Append Field object.
     tdf.fields.Append fld
     Set dbs = Nothing
End Sub
0
 
1WilliamCommented:
I see you are all set now.  :)
0
 
1WilliamCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept question, points to 1William
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

1William
EE Cleanup Volunteer
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now