文件名称:VBformatDataGrid
- 所属分类:
- Windows编程
- 资源属性:
- [Windows] [Visual C] [Basic/ASP] [源码]
- 上传时间:
- 2014-05-05
- 文件大小:
- 90kb
- 下载次数:
- 1次
- 提 供 者:
- cpu****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
我觉得这是一个相当实用的Vb数据库技巧,让VB根据字段类型自动格式化DataGrid表格中的数据,数据库连接驱动为:Provider=Microsoft.Jet.OLEDB.4.0 Data Source=db_manpower.mdb Persist Security Info=False。可将所属工资月份,员工编号,员工姓名,基本工资,加班费,工龄工资,奖励总额,职务津贴,旷工费,惩罚总额,养老保险,失业保险,应扣工资等各字段中的数据自动格式化为规定类型,子处理进程代码:
Dim fld
For Each fld In Adodc1.Recordset.Fields
如果字段类型为money,则格式化该列
If fld.Type = 6 Then
Set f1 = DataGrid1.Columns(fld.Name).DataFormat
f1.Format = "##,##0.00"
End If
Next
End Sub-I think this is a very useful Vb database skills, so VB automatically formatted according to the data field type DataGrid table, database connectivity drivers as: Provider = Microsoft.Jet.OLEDB.4.0 Data Source = db_manpower.mdb Persist Security Info = False. Month salary can be an employee number, employee name, base salary, overtime, seniority pay, total rewards, duties allowance, absenteeism costs, the total punishment, pension insurance, unemployment insurance, and other fields should be reduced if the data is automatically formats as specified type, the child deal with the process of code:
Dim fld
For Each fld In Adodc1.Recordset.Fields
If field type is money, then format the column
If fld.Type = 6 Then
Set f1 = DataGrid1.Columns (fld.Name). DataFormat
f1.Format = "##,## 0.00"
End If
Next
End Sub
Dim fld
For Each fld In Adodc1.Recordset.Fields
如果字段类型为money,则格式化该列
If fld.Type = 6 Then
Set f1 = DataGrid1.Columns(fld.Name).DataFormat
f1.Format = "##,##0.00"
End If
Next
End Sub-I think this is a very useful Vb database skills, so VB automatically formatted according to the data field type DataGrid table, database connectivity drivers as: Provider = Microsoft.Jet.OLEDB.4.0 Data Source = db_manpower.mdb Persist Security Info = False. Month salary can be an employee number, employee name, base salary, overtime, seniority pay, total rewards, duties allowance, absenteeism costs, the total punishment, pension insurance, unemployment insurance, and other fields should be reduced if the data is automatically formats as specified type, the child deal with the process of code:
Dim fld
For Each fld In Adodc1.Recordset.Fields
If field type is money, then format the column
If fld.Type = 6 Then
Set f1 = DataGrid1.Columns (fld.Name). DataFormat
f1.Format = "##,## 0.00"
End If
Next
End Sub
(系统自动生成,下载前可以参看下载内容)
下载文件列表
VB根据字段自动格式化DataGrid表格中的数据\db_manpower.mdb
........................................\main_gzgl.frm
........................................\main_gzgl.frx
........................................\main_gzgl_gzgl.frx
........................................\工程1.vbp
........................................\工程1.vbw
VB根据字段自动格式化DataGrid表格中的数据