当员工处于非活动状态并且输入了日期时,需要在“填充”屏幕中显示该职位,状态为“打开” [英] When employee is made inactive and leave date is entered the position needs to become available in the Fills screen and status is Open
问题描述
   您好,
Hello,
我是VBA访问的新手,希望您能在这里帮助我...
I am a newbie to VBA access, hopefully you can help me here...
Private Sub Active__Inactive_AfterUpdate()
如果Me.Active__Inactive ="Inactive"然后
如果Not IsNull(Me.Leave_Date)和Me.Leave_Date<> ""然后
'填充所有这个位置的填充表
Dim str As String
str =" INSERT INTO tbl_GCDS_Operations_Positions_fills([Name],[Position],[Reporting Level 1],[Group],[Location],[Leave date])_
$
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;选择([名称],[职位],[报告级别1],[组],[位置],[离开日期] _
$
  ; FROM [tbl_Register_MemberList]其中[Position] ='"& Me。[Position]&"';"
db.Execute str,dbFailOnError
结束如果
否则
MsgBox"请确保您已输入a离开日期,否则此位置将不会出现在Postion Fills文件中"
结束如果
结束子
Private Sub Active__Inactive_AfterUpdate()
If Me.Active__Inactive = "Inactive" Then
If Not IsNull(Me.Leave_Date) And Me.Leave_Date <> "" Then
'Populate fills table with all of this position
Dim str As String
str = "INSERT INTO tbl_GCDS_Operations_Positions_fills ([Name],[Position],[Reporting Level 1],[Group],[Location], [Leave date]) _
SELECT ([Name],[Position],[Reporting Level 1],[Group],[Location],[Leave date] _
FROM [tbl_Register_MemberList] Where [Position] = '" & Me.[Position] & "';"
db.Execute str, dbFailOnError
End If
Else
MsgBox "Please make sure you have entered a Leave Date otherwise this position will no appear in the Postion Fills File"
End If
End Sub
推荐答案
究竟是什么问题?如果你的代码不能正常工作,你会收到什么错误信息?
What exactly is the problem? If you're code is not working, what error message are you getting, if any?
这篇关于当员工处于非活动状态并且输入了日期时,需要在“填充”屏幕中显示该职位,状态为“打开”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!