Formatting table fields programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a need to format table fields programmatically. Here are the details.
What I am doing is importing a table. I then do some stuff to it and create
a new table from it containing certain of the records. (I need it to be a
table, not a query or a report). I create the new table OK using SQL
statements.

It may sound odd, but I need all the text fields in the new table to be
uppercase. I, Of course can manually set the format of each field to
uppercase after the table is created, but I need it to be done
programmatically when the table is being created, if it’s possible. I
haven’t been able to find anything on the internet on this issue. Thanks in
advance for any suggestions?
 
You can use DAO to set the Format property of the Field in the TableDef.

Realisitically, it would be better to create the table with DAO in the first
place. This lets you do things such as setting the AllowZeroLength to No for
your text fields, setting the DisplayControl to check box for your yes/no
fields, as well as setting the Format of the fields when you create them.
See help on CreateTable(), CreateField(), and CreateProperty().

I hope you realise that changing the Format of a text field to the
greater-than sign affects only the way the data is displayed. It does not
actually convert the data to upper case.
 
Back
Top