|
原帖由 cuxun 于 2007-9-28 19:13 发表 ![]()
把库传上来帮你看看.
DoCmd.GoToControl "雇员ID"
End If
End Sub
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me![工时卡片子窗体].Form![项目ID].Requery
Me![工时卡片开支子窗体].Form![项目ID].Requery
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub
Private Sub 雇员ID_NotInList(NewData As String, Response As Integer)
MsgBox "双击此字段将增加一个入口到此列表。"
Response = acDataErrContinue
End Sub
Private Sub 雇员ID_DblClick(Cancel As Integer)
On Error GoTo Err_雇员ID_DblClick
Dim lngEmployeeID As Long
If IsNull(Me![雇员ID]) Then
Me![雇员ID].Text = ""
Else
lngEmployeeID = Me![雇员ID]
Me![雇员ID] = Null
End If
DoCmd.OpenForm "雇员", , , , , acDialog, "GotoNew"
Me![雇员ID].Requery
If lngEmployeeID <> 0 Then Me![雇员ID] = lngEmployeeID
Exit_雇员ID_DblClick:
Exit Sub
Err_雇员ID_DblClick:
MsgBox Err.Description
Resume Exit_雇员ID_DblClick
End Sub
Private Sub 工时卡片子窗体_Enter()
If IsNull(Me![雇员ID]) Then
MsgBox "请在输入工时或开支之前输入雇员。"
DoCmd.GoToControl "雇员ID"
End If
End Sub
Private Sub 工时卡片开支子窗体_Enter()
If IsNull(Me![雇员ID]) Then
MsgBox "请在输入工时或开支之前输入雇员。"
DoCmd.GoToControl "雇员ID"
End If
End Sub
Private Sub 预览时间卡片_Click()
On Error GoTo 预览时间卡片_Err
If IsNull(Me![时间卡片ID]) Then
MsgBox "请在预览工时卡报表之前输入工时卡片信息。"
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenReport "时间表", acPreview, , "[时间卡片ID]=" & [时间卡片ID]
End If
预览时间卡片_Exit:
Exit Sub
预览时间卡片_Err:
MsgBox Err.Description
Resume 预览时间卡片_Exit
End Sub
Me.工时卡片.SetFocus
DoCmd.GoToRecord , , acLast
End Sub
这个就是了 |
|