问题描述
Private Sub SupplierSKUCode_AfterUpdate()
如果是Nz(DLookup(SupplierSKUCode,tblProduct,SupplierSKUCode =''"& _
Me.SupplierSKUCode&"''")," zzzz")<> " ZZZZ"然后MsgBoxSupplierSKUCode已经存在。,vbCritical
如果MsgBox(重复记录。_
& vbCrLf& vbCrLf& ;你想要重复记录吗?_
,vbYesNo,所做的改变......= vbYes然后
Me.ProductDescription。 SetFocus
Else
Me.SupplierSKUCode.SetFocus
DoCmd.RunCommand acCmdUndo
Me.SupplierSKUCode.SetFocus
结束如果
''测试控件是否包含文本
如果IsNull(Screen.ActiveControl)= False那么
''将文本转换为正确的案例
Screen.ActiveControl = StrConv(Screen.ActiveControl,vbUpperCase)
结束如果
结束子
设定的焦点似乎不起作用,请帮我解释我的编码错误.tnx
Private Sub SupplierSKUCode_AfterUpdate()
If Nz(DLookup("SupplierSKUCode", "tblProduct", "SupplierSKUCode=''" & _
Me.SupplierSKUCode & "''"), "zzzz") <> "zzzz" Then MsgBox "SupplierSKUCode Already Exist.", vbCritical
If MsgBox("Duplicate Record." _
& vbCrLf & vbCrLf & "Do you want to have Duplicate Record?" _
, vbYesNo, "Changes Made...") = vbYes Then
Me.ProductDescription.SetFocus
Else
Me.SupplierSKUCode.SetFocus
DoCmd.RunCommand acCmdUndo
Me.SupplierSKUCode.SetFocus
End If
''Test if control contains text
If IsNull(Screen.ActiveControl) = False Then
''convert text to Proper Case
Screen.ActiveControl = StrConv(Screen.ActiveControl, vbUpperCase)
End If
End Sub
The set focus doesnt seem to work, please help me whats wrong with my coding..tnx
推荐答案
为什么你设定焦点了吗?
Why are you setting the focus?
这篇关于SetFocus似乎不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!