急了一天,不能移到指定记录。求助!
发票代码表四个字段:fpdm,fpID,xsrq,bs 均为字符型数据fpdm字段中有多条记录,如:0844001,0844051,0844101,0844151,0844201,0844251.。。。。
窗体文本框“起始码” =“0844151”
Me![本数]=3
写如下程序后在运行到红字处提示错,拜托高手给指点一下,先谢谢了!
Set Rs = New ADODB.Recordset
StrTemp = "Select * From 发票代码"
Rs.Open StrTemp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Rs.MoveFirst
'在“发票代码”表查找是否存在与待保存的发票代码记录相同
DoCmd.GoToRecord acActiveDataObject, , acFirst
DoCmd.FindRecord Rs("fpdm") = Me("起始码"), , True, , True
For i = 1 To Val(Me![本数])
Rs("xsrq") = Me![销售日期]
Rs("bs") = "0"
DoCmd.GoToRecord , , acNext
Next
Rs.Update
Rs.Close