当员工处于非活动状态并且输入了日期时,需要在“填充”屏幕中显示该职位,状态为“打开” [英] When employee is made inactive and leave date is entered the position needs to become available in the Fills screen and status is Open

查看:76
本文介绍了当员工处于非活动状态并且输入了日期时,需要在“填充”屏幕中显示该职位,状态为“打开”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

   您好, 

    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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆