If Tables("窗口1_hr").Current Is Nothing Then msgbox("表没有数据") Else Dim Val As Date = Date.Today If InputValue(Val, "提示","请输入日期:") Then Output.Show(Val) End If Dim d1 As Date= Tables("窗口1_hr") .Current ("入职日期") Tables("窗口1_hr") .Current ("工龄")= Date.Today().Year-d1.Year & "年" & Math.Abs(Date.Today().Month-d1.Month) & "月"