stretch66
Racing towards the start
- Local time
- Today, 23:47
- Joined
- Sep 28, 2005
- Messages
- 72
Hi,
Quite new to Access and am developing an HR database for work.
Have a EmployeeIntro form with standard employee information including the Payroll Number which is the primary key. The Employee Intro Form includes a button with a link to Personal Details which holds all employee information.
I need to link the two forms so that when they are in record Joe Bloggs on the Employee Intro they can click the Personal Details Button and see Joe Bloggs records. Obviously there is some condition where the field Payroll_Number on EmployeeIntro = the field Payroll_Number on PersonalDetails but havn't done any coding for about 2yrs and never used VB so don't know the syntax.....can anyone help please.
Have included the code below for the Employee Intro Form.
Private Sub PersonalDetailsButton_Click()
On Error GoTo Err_PersonalDetailsButton_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fmPersonalDetails"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "fmEmployeeIntro"
Exit_PersonalDetailsButton_Click:
Exit Sub
Err_PersonalDetailsButton_Click:
MsgBox Err.Description
Resume Exit_PersonalDetailsButton_Click
End Sub
Thanks
Quite new to Access and am developing an HR database for work.
Have a EmployeeIntro form with standard employee information including the Payroll Number which is the primary key. The Employee Intro Form includes a button with a link to Personal Details which holds all employee information.
I need to link the two forms so that when they are in record Joe Bloggs on the Employee Intro they can click the Personal Details Button and see Joe Bloggs records. Obviously there is some condition where the field Payroll_Number on EmployeeIntro = the field Payroll_Number on PersonalDetails but havn't done any coding for about 2yrs and never used VB so don't know the syntax.....can anyone help please.
Have included the code below for the Employee Intro Form.
Private Sub PersonalDetailsButton_Click()
On Error GoTo Err_PersonalDetailsButton_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fmPersonalDetails"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "fmEmployeeIntro"
Exit_PersonalDetailsButton_Click:
Exit Sub
Err_PersonalDetailsButton_Click:
MsgBox Err.Description
Resume Exit_PersonalDetailsButton_Click
End Sub
Thanks