• Change the format propert (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Change the format propert (Access 2000)

    Author
    Topic
    #443580

    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

    Viewing 0 reply threads
    Author
    Replies
    • #1070246

      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.

    Viewing 0 reply threads
    Reply To: Reply #1070246 in Change the format propert (Access 2000)

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

    Your information:




    Cancel