|
本帖最后由 VulcanTerry 于 2013-5-14 16:36 编辑
Dim rsPromotion As New ADODB.Recordset
Dim conx As New ADODB.Connection
Dim strPromotionSQL As String
Dim strPromotionCode As String
strPromotionSQL = "select * from tblPromotion"
Set conx = CurrentProject.Connection
rsPromotion.Open strPromotionSQL, conx, adOpenKeyset, adLockOptimistic
rsPromotion.AddNew
rsPromotion("PromotionCode") = PromotionAutoNum(Me.cboActivityCategoryID)
rsPromotion("ProposerID") = Me.cboEmployeeID
rsPromotion("Department") = Me.txtDepartment
rsPromotion("ApplicationDate") = Me.txtApplictionDate
rsPromotion("ActivityCategoryID") = Me.cboActivityCategoryID
rsPromotion("Activity") = Me.txtActivity
rsPromotion("ActivityDate") = Me.txtActivityDate
rsPromotion("Backdrop") = Me.txtBackdrop
rsPromotion("Objective") = Me.txtObjective
rsPromotion("Explain") = Me.txtExplain
rsPromotion("AmountExplain") = Me.txtAmountExplain
rsPromotion("Amount") = Me.txtAmount
rsPromotion.Update
rsPromotion.Close
Set rsPromotion = Nothing
Set conx = Nothing
如果通过其他窗体打开,执行此段代码,系统提示不能更新。不知道代码哪里有错,应该和窗体的设置没有关系吧 |
|