U
Uni
Hi -
I have two tables - one position, one personnel - which has a 1-to-many
relationship (1 position record to many personnel records). The department
had a new requirement which made it necessary to change some coding (I
inherited this). I'm using tab forms so that when a position is pulled up,
you can click on the tab that has the personnel information (if there is
any). There is a button on the Personnel form that allows the user to add a
new Personnel record. Since I am using an Auto-number field in the Position
table (which doubles as the PK) the functionality is fine. What I need is to
capture only one data field from the Position table and auto-populate the
corresponding Personnel field (Position.NewLineNo -> Personnel.NewLineNo).
The current code for the OnClick() event to Add Personnel to the Personnel
table is:
Private Sub cmdAddPerson_Click()
On Error GoTo Err_cmdAddPerson_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdAddPerson_Click:
Exit Sub
Err_cmdAddPerson_Click:
MsgBox Err.Description
Resume Exit_cmdAddPerson_Click
End Sub
Any help or advice would be greatly appreciated.
Thanks in advance.
Uni
I have two tables - one position, one personnel - which has a 1-to-many
relationship (1 position record to many personnel records). The department
had a new requirement which made it necessary to change some coding (I
inherited this). I'm using tab forms so that when a position is pulled up,
you can click on the tab that has the personnel information (if there is
any). There is a button on the Personnel form that allows the user to add a
new Personnel record. Since I am using an Auto-number field in the Position
table (which doubles as the PK) the functionality is fine. What I need is to
capture only one data field from the Position table and auto-populate the
corresponding Personnel field (Position.NewLineNo -> Personnel.NewLineNo).
The current code for the OnClick() event to Add Personnel to the Personnel
table is:
Private Sub cmdAddPerson_Click()
On Error GoTo Err_cmdAddPerson_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdAddPerson_Click:
Exit Sub
Err_cmdAddPerson_Click:
MsgBox Err.Description
Resume Exit_cmdAddPerson_Click
End Sub
Any help or advice would be greatly appreciated.
Thanks in advance.
Uni