|
文本框更新事件後不能重新獲得焦點,請幫忙看看下面代碼是哪不對?
Private Sub Text16_AfterUpdate()
Me.Text16.SetFocus
Dim Temp As String
If Me![Text10] <> "" And Me![Text16] <> "" Then
Temp = "insert into 生產入庫(上架類型,廠別,生產單位,庫區,上架方式,托盤號,備注,條碼讀取,生產日期,品質區分,箱數)"
Temp = Temp & "values('" & Me![Text0] & "','" & Me![Text2] & "','" & Me![Text4] & "','" & Me![Text6] & "','" & Me![Text8] & "','" & Me![Text10] & "','" & Me![Text14] & "','" & Me![Text16] & "','" & Me![Text20] & "','" & Me![Text22] & "',1)"
DoCmd.RunSQL Temp
Me![Text16] = ""
Me.入庫上架_子表單1.Requery
Me.List49.Requery
Me.Text16.SetFocus ‘此代碼不執行而是移到了下一個控件
Else
MsgBox "托盤號和條碼不能為空"
Me.Text16.SetFocus
End If
End Sub |
|