Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: New User. Simple code doesn't work.

    Hi there:

    I am trying to use this simple code. It doesn't work. Could someone tell me what I am doing wrong:

    I did add reference to the DAO 3.6. All I am trying to do is create a description property for each field I create.

    Thanks for any help.
    Shahab


    Sub CreateDescrip()

    Dim db As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Field
    Dim prp As DAO.Property

    Set db = DBEngine(0)(0)
    Set tdf = db.TableDefs("MyTable")
    Set fld = tdf.Fields("MyField")
    Set prp = fld.CreateProperty("Description", dbText, _
    "Put your description in here.")
    fld.Properties.Append prp

    End Sub

  2. #2
    Join Date
    Mar 2004
    Posts
    2

    Re: New User. Simple code doesn't work.

    Hey all..

    The code worked after I quit Access and came back and tried again.

    Thanks
    Shahab

    Originally posted by sahmednc0
    Hi there:

    I am trying to use this simple code. It doesn't work. Could someone tell me what I am doing wrong:

    I did add reference to the DAO 3.6. All I am trying to do is create a description property for each field I create.

    Thanks for any help.
    Shahab


    Sub CreateDescrip()

    Dim db As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Field
    Dim prp As DAO.Property

    Set db = DBEngine(0)(0)
    Set tdf = db.TableDefs("MyTable")
    Set fld = tdf.Fields("MyField")
    Set prp = fld.CreateProperty("Description", dbText, _
    "Put your description in here.")
    fld.Properties.Append prp

    End Sub

Posting Permissions

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