• Programmatically Setting Default Values (97 SR-2 on Win NT 4.0)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Programmatically Setting Default Values (97 SR-2 on Win NT 4.0)

    Author
    Topic
    #363478

    I have built a module that will copy a “bare-bones” empty table, then add fields to it based on fields created in a crosstab query. In that, I then have a table that has several fields created on the fly. Is it possible to set the default value to the new fields I’ve added? I did not find it in “Attributes”, and I’m not sure where else to look.

    Thanx

    Jeff

    Viewing 0 reply threads
    Author
    Replies
    • #554655

      Hi Jeff,
      Fields have a DefaultValue property which you can set – it’s just Field.DefaultValue rather than being one of the Field.Attributes.
      Hope that helps.

      • #554721

        Set fld = TDFTest.CreateField(qdfField.Fields(2).NAME, dbText, 11)
        fld.DefaultValue = 0
        TDFTest.Fields.Append fld

        HEY MOE! IT WOIKS! Nyuk Nyuk Nyuk.

        Thanks much.

    Viewing 0 reply threads
    Reply To: Programmatically Setting Default Values (97 SR-2 on Win NT 4.0)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: