Hello all,
I'm working on a job not single form, frmJobNote that I'm opening with a command button from from, frmNew. I'm using the following to open frmJobNote.
Code:
Private Sub cmdJobNote_Click() strDocName = "frmJobNote"
DoCmd.OpenForm strDocName
With Forms(strDocName)
.txtFrmTitle.Value = Me.sfrmTCNewJob!cboJobID.Column(1) & " Notes"
.txtJobID.Value = Me.sfrmTCNewJob!cboJobID
.txtNoteDate.Value = Now()
End With
End Sub
This works, but not for what I'm attempting. I would like frmJobNote to open to the record that matches the current date and job from frmNew. If there is not an existing record for this date and job combination I would like a new record created for this combination. Aside from being new with VBA, I'm not familiar with coding for dates.
Can anyone help me create the code for a command button to open a form and look for an existing record for both the JobID and the current date, then create a new record if this does not exist?
Thank you for having a look,
John