Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting / validating data in columns in DataGrid

Status
Not open for further replies.

Halina

Programmer
Dec 5, 2000
6
US
I am using a data bound DataGrid and I need to validate the data that is input into the datagrid. How can I make the datagrid use the same data properties as the database is using. (I am using Access 97). What I mean is if the database allows only numbers in a particular field how can I make the datagrid only allow numbers in that field? Also, how can I format a column to be all Caps?
 
Dim objColumns As Columns

Set objColumns = DataGrid1.Columns 'create Columns Object
objColumns.Item(0).Alignment = dbgRight 'right align column data
objColumns.Item(0).AllowSizing = False 'disable changing of column width
objColumns.Item(0).Caption = "Pub ID #" 'change column heading
objColumns.Item(0).Locked = True 'don't allow it to be selected
objColumns.Item(4).Button = True 'display button when selected
objColumns.Item(5).Button = True
objColumns.Item(5).Width = 2000 'set column width to 2000 pixels
objColumns.Item(7).NumberFormat = "(###)###-####" 'format a number Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top