Two Questions updating forms

KristenD

Registered User.
Local time
Today, 06:09
Joined
Apr 2, 2012
Messages
394
I am currently re-working my database and have updated a few tables, deleted a duplicate fields from tables. I currently have a pop up form that has some code behind it. I also changed a few things in the table (deleting the duplicate fields). So in tblEmpJobs there is no longer a field for CraftCode, EmpType, or DateOnJob. But the record source below still has those fields in the form?? I thought Access would automatically update if fields were deleted or moved?

Code:
SELECT [tblEmpJobs].EmpInfoID, [tblEmpJobs].EmpIDFK, [tblEmpJobs].JobNumberFK, [tblJobs].[JobSite], [tblEmpJobs].CraftCode, [tblEmpJobs].EmpType, [tblEmpJobs].DateOnJob FROM tblJobs INNER JOIN tblEmpJobs ON tblJobs.JobNum=[tblEmpJobs].JobNumberFK;

Other Question:
The code below is for the pop up form that is based on the employment status. Ideally what I would like to be able to do is track the employees by date of when they were on a certain job. I deleted the Date field in the tblEmpJobs because it is essentially tracked when they are hired, rehired or transferred. And I can probably by a junction table or query tie that information together. But this is my main problem right now, once I input the job information and I move to another employee, the record starts over. For example, I go and enter information for emp 1234 and I put the job info in, then I go to employee 5678 and put the info in for them. Then I go back to emp 1234 and the form pops up again but it is blank and says record 1 of 1 again. How do I fix this?

Code:
Private Sub EmploymentStatus_AfterUpdate()
If Me.EmploymentStatus = "Active" Then
    Me.tblEmpInfo.Visible = True
    
Else
    Me.tblEmpInfo.Visible = False
    
End If
End Sub
Private Sub Form_Current()
If Me.NewRecord Then
    Me.tblEmpInfo.Visible = True
    
Else
    If Me.EmploymentStatus = "Active" Then
        Me.tblEmpInfo.Visible = True
    Else
        Me.tblEmpInfo.Visible = False
    End If
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom