Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table descriptions (Access XP)

    I have a routine to import a number of files into separate tables. I want to then set the description of each file. However, I get an error 3270 - Property not found when I try to set the description of the table.

    DoCmd.TransferText Transfertype:=sTransfertype, specificationname:=stable, _
    TableName:=stable, filename:=sfilename, HasFieldNames:=False
    CurrentDb.TableDefs(stable).Properties("Descriptio n") = "Test"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Table descriptions (Access XP)

    If the property doesn't exist, you'll have to create it:

    Dim dbs As DAO.Database
    Dim tdf As DAO.TableDef
    Dim prp As DAO.Property

    DoCmd.TransferText ...

    ' It is essential to use a variable of type Database!
    Set dbs = CurrentDb
    Set tdf = dbs.TableDefs(sTable)
    On Error Resume Next
    Set prp = tdf.Properties("Description")
    On Error GoTo 0
    If prp Is Nothing Then
    Set prp = tdf.CreateProperty("Description", dbText, "Test")
    tdf.Properties.Append prp
    Else
    prp.Value = "Test"
    End If

  3. #3
    New Lounger
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table descriptions (Access XP)

    Thank you Hans. It works perfectly <img src=/S/smile.gif border=0 alt=smile width=15 height=15> <img src=/S/bouncenburn.gif border=0 alt=bouncenburn width=31 height=31>

Posting Permissions

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