T
t568aort568b
Here is my current code. It works but it is a little to slow for my
liking.
What I am trying to do is:
I have an form called ""assignments"" open. When I change the status
on the assignment form I want to change the status of the employee with
on the "employee input" form with the same EMPID#. I would like to do
this hidden so the user do not see this happening.
Thanks for the help as always,
Eric
Private Sub Status_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.Hourglass True
stDocName = "Employee Input"
stLinkCriteria = "[SocialSecurityNumber]=" &
Me![SocialSecurityNumber]
DoCmd.OpenForm stDocName, , , , acFormEdit, acHidden
Set rs = Forms(stDocName).Recordset.Clone
rs.FindFirst stLinkCriteria
If Not rs.EOF Then Forms(stDocName).Bookmark = rs.Bookmark
If (Me.Status = "filled") Then
Forms![Employee Input]!Status = "Working"
'End If
ElseIf (Me.Status = "complete") Then
Forms![Employee Input]!Status = "Avail"
'End If
ElseIf (Me.Status = "terminated") Then
Forms![Employee Input]!Status = "Do Not Use"
'End If
ElseIf (Me.Status = "cancelled") Then
Forms![Employee Input]!Status = "Avail"
'End If
ElseIf (Me.Status = "ncns") Then
Forms![Employee Input]!Status = "Do Not Use"
'End If
ElseIf (Me.Status = "went perm") Then
Forms![Employee Input]!Status = "Went Perm"
'End If
ElseIf (Me.Status = "quit") Then
Forms![Employee Input]!Status = "Do Not Use"
'End If
ElseIf (Me.Status = "open") Then
Forms![Employee Input]!Status = "Avail"
End If
DoCmd.Close acForm, "Employee Input", acSaveYes
DoCmd.OpenForm stDocName
Set rs = Forms(stDocName).Recordset.Clone
rs.FindFirst stLinkCriteria
If Not rs.EOF Then Forms(stDocName).Bookmark = rs.Bookmark
DoCmd.Minimize
DoCmd.Hourglass False
End Sub
liking.
What I am trying to do is:
I have an form called ""assignments"" open. When I change the status
on the assignment form I want to change the status of the employee with
on the "employee input" form with the same EMPID#. I would like to do
this hidden so the user do not see this happening.
Thanks for the help as always,
Eric
Private Sub Status_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.Hourglass True
stDocName = "Employee Input"
stLinkCriteria = "[SocialSecurityNumber]=" &
Me![SocialSecurityNumber]
DoCmd.OpenForm stDocName, , , , acFormEdit, acHidden
Set rs = Forms(stDocName).Recordset.Clone
rs.FindFirst stLinkCriteria
If Not rs.EOF Then Forms(stDocName).Bookmark = rs.Bookmark
If (Me.Status = "filled") Then
Forms![Employee Input]!Status = "Working"
'End If
ElseIf (Me.Status = "complete") Then
Forms![Employee Input]!Status = "Avail"
'End If
ElseIf (Me.Status = "terminated") Then
Forms![Employee Input]!Status = "Do Not Use"
'End If
ElseIf (Me.Status = "cancelled") Then
Forms![Employee Input]!Status = "Avail"
'End If
ElseIf (Me.Status = "ncns") Then
Forms![Employee Input]!Status = "Do Not Use"
'End If
ElseIf (Me.Status = "went perm") Then
Forms![Employee Input]!Status = "Went Perm"
'End If
ElseIf (Me.Status = "quit") Then
Forms![Employee Input]!Status = "Do Not Use"
'End If
ElseIf (Me.Status = "open") Then
Forms![Employee Input]!Status = "Avail"
End If
DoCmd.Close acForm, "Employee Input", acSaveYes
DoCmd.OpenForm stDocName
Set rs = Forms(stDocName).Recordset.Clone
rs.FindFirst stLinkCriteria
If Not rs.EOF Then Forms(stDocName).Bookmark = rs.Bookmark
DoCmd.Minimize
DoCmd.Hourglass False
End Sub