Sending Data from One Form to Another

  • Thread starter Thread starter JJ Jigga Johns
  • Start date Start date
J

JJ Jigga Johns

I have a database that our center uses to track work performed by
operators. Entering a job into the DB is done in two parts, first
someone logs a job, then an operator or operators are added to the
record. I would like to streamline the adding operator process.
Each job entered is given an ID (of course), to make it easy for
people, I've added a macro so that when you double click the Job ID, it
opens the add operator form. What I would like to do is when you
double click a specific job id it opens the add operator form to that
same record. I haven't been able to do so yet. I've tried simple
things like a macro to copy and paste, but no luck. Any ideas?
 
Use the WhereCondition of the OpenForm to open to the specific record.

This example assumes JobID is a Number field:

Private Sub JobID_DblClick(Cancel As Integer)
If IsNull(Me.JobID) Then
DoCmd.OpenForm "frmJob",DataMode:=acFormAdd
Else
DoCmd.OpenForm "frmJob",WhereCondition:="JobID = " & Me.JobID
End If
End Sub
 
Back
Top