Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change the format propert (Access 2000)

    Can i change the format property of the field in a remote database? Up to now the format property was set to Eur, and i want to have at as currency.I know how to create the field,but i do not know how to change the property
    Dim wsp As DAO.Workspace
    Dim dbs As DAO.Database
    Dim prp As DAO.Property
    Dim tdf As DAO.TableDef
    Dim fld As DAO.field
    Set wsp = DAO.DBEngine.Workspaces(0)
    Set dbs = wsp.OpenDatabase("C:BEstoreBE.mdb", False, False, ";PWD=" & StrPassword)
    Set tdf = dbs.TableDefs("Products")
    ' create the field exworks
    Set fld = tdf.CreateField("exworks", dbCurrency)
    tdf.Fields.Append fld

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

    Re: Change the format propert (Access 2000)

    Change the last two lines

    Set fld = tdf.CreateField("exworks", dbCurrency)
    tdf.Fields.Append fld

    to

    Set fld = tdf.Fields("exworks")
    fld.Properties("Format") = "Currency"

    Since the field already exists, you don;t have to create it, and you don't need to append it any more.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change the format propert (Access 2000)

    Thank you so much Hans ! As always perfect

Posting Permissions

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