应用于计算公制方法,把字符公制,如:23 7/8转换成英寸数字方法
时 间:2012-05-17 15:52:55
作 者:李财盛 ID:20277 城市:东莞
摘 要:'===============================
'应用于计算公制方法,把字符公制,如:23 7/8转换成英寸数字方法
'编写于:2012-05-17 add:LCS
'调用: 变量= F_GZ("23 7/8")
'===================================
正 文:
Option Compare Database
'=========================================================
'应用于计算公制方法,把字符公制,如:23 7/8转换成英寸数字方法
'编写于:2012-05-17 add:LCS
'调用: 变量= F_GZ("23 7/8")
'=========================================================
Public Function F_GZ(ByVal LWStr As String) As Currency
Dim SFIX As Double
Dim Leftint As Currency, leftstr As String
Dim rightint As Currency, rightstr As String
Dim S() As String
REM_S:
S = Split(RTrim(LTrim(LWStr)), " ")
Dim I As Long, J As Long
J = 0
Dim SSTR As String
SSTR = LTrim(RTrim(LWStr))
If UBound(S) > 1 Then
For I = 1 To LenB(LWStr)
If Mid(SSTR, I, 1) = " " And J = 0 Then
J = I
Exit For
End If
Next I
LWStr = Mid(SSTR, 1, J) & Replace(SSTR, " ", "", J + 1)
GoTo REM_S
End If
Dim CRS As New ADODB.Recordset
If UBound(S) = 1 Then
Leftint = CCur(S(0))
CRS.CursorLocation = adUseClient
CRS.Open "Select " & S(1) & "", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
rightint = Nz(CRS.Fields(0), 0)
CRS.Close
Set CRS = Nothing
F_GZ = Leftint + rightint
'FRMNAME.Controls(Frmfields) = F_GZ
ElseIf UBound(S) = 0 Then
Leftint = CCur(S(0))
F_GZ = Leftint
'FRMNAME.Controls(Frmfields) = F_GZ
Else
End If
End Function
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access对子窗体数据进行批...(10.30)
- 最精简的组合框行来源数据快速输...(10.25)
- Access仿平台的多值选择器...(10.24)
- 【Access日期区间段查询】...(10.22)
- 【Access源码示例】VBA...(10.12)
- Access累乘示例,Acce...(10.09)
- 数值8.88,把整数8去掉,转...(10.08)
- 【Access自定义函数】一个...(09.30)
- 【Access选项卡示例】Ac...(09.09)
学习心得
最新文章
- 【Access IIF函数嵌套示例...(11.26)
- Access快速开发平台--使用组...(11.25)
- Access快速开发平台--对上传...(11.22)
- Access快速开发平台企业版--...(11.18)
- 不会用多表联合查询,多表查询没结果...(11.16)
- 【案例分享】主键字段值含有不间断空...(11.16)
- Access快速开发平台--后台D...(11.14)
- 微软Access邀测新Monaco...(11.12)
- Access列表框左右互选、列表框...(11.11)
- 高效率在导入数据前删除记录(11.10)