If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
change to standard format
Set tbl = db.TableDefs("Invoice")
tbl.Fields.Append tbl.CreateField("amount", dbCurrency) the above code is working well. However, the below code, I cannot change the format (standard), no dollar sign. tbl.Fields("amount").Properties("Format") = "Standard" The message said that "property no found" What's wrong with it? How can I change the format (standard)? Please let me know, thanks. |
#2
|
|||
|
|||
change to standard format
Not all properties are created when a field is created: some are only
created when they're required. Try the following: Dim fld As DAO.Field Dim prp As DAO.Property Set tbl = db.TableDefs("Invoice") Set fld = tbl.CreateField("amount", dbCurrency) Set prp = fld.CreateProperty("Format", dbText, "Standard") fld.Properties.Append prp tbl.Fields.Append fld -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "accessman2" wrote in message . .. Set tbl = db.TableDefs("Invoice") tbl.Fields.Append tbl.CreateField("amount", dbCurrency) the above code is working well. However, the below code, I cannot change the format (standard), no dollar sign. tbl.Fields("amount").Properties("Format") = "Standard" The message said that "property no found" What's wrong with it? How can I change the format (standard)? Please let me know, thanks. -- accessman2 |
#3
|
|||
|
|||
change to standard format
On Sun, 29 Jan 2006 16:44:49 +0000, accessman2
wrote: Set tbl = db.TableDefs("Invoice") tbl.Fields.Append tbl.CreateField("amount", dbCurrency) the above code is working well. However, the below code, I cannot change the format (standard), no dollar sign. tbl.Fields("amount").Properties("Format") = "Standard" The message said that "property no found" What's wrong with it? How can I change the format (standard)? Please let me know, thanks. You may need to add the Format property to the field - if there is none, it's not there to change. However, the format of a Table field is - generally - completely irrelevant. You shouldn't be displaying data in Tables in any case; and you can easily set the format property of a Form or Report textbox in which you're displaying the [Amount] field. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can I change a date with no format (20051111) to date format? | Rose | New Users | 2 | November 11th, 2005 09:03 PM |
format change | Terry | Charts and Charting | 2 | November 2nd, 2005 02:11 AM |
Change General Format to Currency Format | Freshman | Worksheet Functions | 3 | July 8th, 2005 03:42 AM |
Change FORMAT | viddom | General Discussion | 1 | July 1st, 2005 06:06 PM |
email format | Lloyd | General Discussion | 1 | June 16th, 2004 03:42 AM |