ok, slight problem.
the job table and the job pickup table are linked using the job id.
i have just discovered the button feature of access. i have used a button to open a form, and if the job is present in both tables then the subsequent record is found and displayed in the relevant form.
eg. if job id 1 has pickup details, then they will be displayed in the job pickup form when the button is pressed.
if its a new job, job id 5 for example (which doesnt have any pickup details registered), then it simply opens the job pickup form blank.. i would want the job id from the first form to be transfered into the job id field of the second form.
here is the code on my job form.
and here is the code for my job pickup form
help please!
the job table and the job pickup table are linked using the job id.
i have just discovered the button feature of access. i have used a button to open a form, and if the job is present in both tables then the subsequent record is found and displayed in the relevant form.
eg. if job id 1 has pickup details, then they will be displayed in the job pickup form when the button is pressed.
if its a new job, job id 5 for example (which doesnt have any pickup details registered), then it simply opens the job pickup form blank.. i would want the job id from the first form to be transfered into the job id field of the second form.
here is the code on my job form.
Code:
Option Compare Database
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "job pickup"
stLinkCriteria = "[job id]=" & Me![job id]
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.[job id]
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub
and here is the code for my job pickup form
Code:
Option Compare Database
Private Sub Form_BeforeInsert(Cancel As Integer)
Me.[job id] = Me.OpenArgs
End Sub
help please!