Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

False/ True format

aralaral Member Posts: 25
How can i create the field but in such a way as to
obtain the True and False instead of Yes and No ? I have to format it to True/False but writing "True/False" in the line below seems not to be the right way.I am sending the code in another town,therefore i can not use the simple design method


' set additional field properties
Set fld = tdf.Fields("session")
fld.Properties("DefaultValue") = "= False"
Set prp = fld.CreateProperty("Format", dbText, "Yes/No")
fld.Properties.Append prp

Comments

  • splansingsplansing Member Posts: 140
    : How can i create the field but in such a way as to
    : obtain the True and False instead of Yes and No ? I have to format it to True/False but writing "True/False" in the line below seems not to be the right way.I am sending the code in another town,therefore i can not use the simple design method
    :
    :
    : ' set additional field properties
    : Set fld = tdf.Fields("session")
    : fld.Properties("DefaultValue") = "= False"
    : Set prp = fld.CreateProperty("Format", dbText, "Yes/No")
    : fld.Properties.Append prp
    :
    :
    There is a Jet statement you can use to change existing fields since you know exactly what you want to do. Add the Jet library to your references and check out the ALTER TABLE statement. This may work a little better.

    Check out this website for complete information on modifying fields programmatically, using DAO:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;249682

    The code they have introduced is prepared to deal with everything that might get in the way of modifying a field, like an index or a relationship. If you break the code down, you'll find you can simplify it a great deal if you know you don't have to deal with those problems and you know how you plan to modify the field. The code is also written by a schizophrenic, apparently, and can be streamlined quite a bit.
Sign In or Register to comment.