Entering new note in a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I open a new form based on the selected field [ID] in the main form. This
form has three fields [ID], [datesnotes] and [notes]. It is used to enter
notes for this customer. How do I add a new note without having to enter the
[ID] number in the new line.
 
Eddie,

From form design view, with the wizard enabled (View, Toolbox, and toggle on
the wand and stars button), place a new command button on your form, choosing
Form Operations, OpenForm, <choose the form>, and Open to Specific Data.
Then indicate the matching fields on each form. It will write code similar
to:

Private Sub Command18_Click()
On Error GoTo Err_Command18_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDuctTakeoff"

stLinkCriteria = "[JobNumber]=" & "'" & Me![cboJobNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command18_Click:
Exit Sub

Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click

End Sub

HTH
Sprinks
 
Back
Top