Form w/ Data Entry Form Connected

  • Thread starter Thread starter Aimee
  • Start date Start date
A

Aimee

I have a main form (frmAnswers) that has a command button
link that opens another form (frmNotes). When the user
clicks the Notes button in frmAnswers, the frmNotes form
opens to allow the user to enter notes about the selected
answers in the main form. The two forms are connected by
RespondentID by [frmNotes][RespondentID]=[frmAnswers]!
[RespondentID] in the RespondentID text box of frmNotes.

My problem is that when I check to make sure the
information is in the table for frmNotes, the RespondentID
table column is blank. How can I make it so the
RespondentID column in the table contains information?

Any help would be appreciated.

Thank you, Aimee
 
I have a main form (frmAnswers) that has a command button
link that opens another form (frmNotes). When the user
clicks the Notes button in frmAnswers, the frmNotes form
opens to allow the user to enter notes about the selected
answers in the main form. The two forms are connected by
RespondentID by [frmNotes][RespondentID]=[frmAnswers]!
[RespondentID] in the RespondentID text box of frmNotes.

This will simply DISPLAY whatever is in the frmAnswers control - it
will do nothing to actually store that ID in the table, as you
observe.
My problem is that when I check to make sure the
information is in the table for frmNotes, the RespondentID
table column is blank. How can I make it so the
RespondentID column in the table contains information?

The simplest way would be to make frmNotes a Subform of frmAnswers,
perhaps putting it on a second page of a Tab control.

If you really prefer the separate, popup form, one way to do this is
to pass the ID in the OpenArgs argument of the OpenForm event in the
command button code; then in the Open event of frmNotes, set the
Default Value property of a *bound* RespondantID field to the value in
OpenArgs. Snippets of code:

DoCmd.OpenForm strDocument, strWhere, OpenArgs := Me!RespondentID

....

Private Sub Form_Open()
If Me.OpenArgs & "" <> "" Then
Me.RespondentID.DefaultValue = """" & Me.OpenArgs & """"
End If
End Sub
 
Back
Top