我的"入库表"中设置的单价是"money"格式,小数位置设置为4位。可在绑定该表的窗体的文本框输入价格时却老是提示不正确,保存不了。进程序查看发现指向“单价”的文本框即使输入了数值,可值却为""。将"入库表"中的单价改为nvarchar数据类型后,就能保存。请问到底是怎么回事啊?由于要在后面对单价进行计算的。可数据格式设置不了。该怎么办啊?
该段代码如下:
Private Sub image008_click()
Set rs = New ADODB.Recordset
Set rs.ActiveConnection = CurrentProject.Connection
If Me.Text0 = "" Then
MsgBox "你输入的信息不完整,请输入完整信息!", vbOKOnly, "警告信息"
Else
temp = "select * from 入库表 where 零件号='"
temp = temp & UCase(Me.零件号) & " ' "
rs.Open temp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.AddNew
rs("零件号") = UCase(Me.Text0)
rs("入库单号") = (Me.Text2)
rs("入库数量") = (Me.Text4)
rs("供货商") = (Me.Text8)
rs("入库日期") = (Me.Text10)
rs("零件仓") = (Me.Text12)
rs("单价") = (Me.Text14)
rs("单位") = (Me.Text16)
rs("票据") = (Me.Text18)
rs("备注") = (Me.Text20)
rs.Update
Me.入库表_子窗体.Requery
rs.Close
rs.Open "select getdate() as svrtime"
Me.Text0 = ""
Me.Text2 = ""
Me.Text4 = ""
Me.Text8 = ""
Me.Text10 = Format(rs.Fields("svrtime"), "short date")
Me.Text12 = ""
Me.Text14 = ""
Me.Text16 = "件"
Me.Text18 = "有"
Me.Text20 = "无"
End If
Me.Text0.SetFocus
End Sub
第一次做ADP,很多都不懂。各位老大帮帮忙看下。拜托了![em04][em04]
[此贴子已经被作者于2006-6-17 11:41:33编辑过]
|