H
HumanJHawkins
HI all,
I have a form with some data that has a subform with some related data.
I have an edit box and a command button on my main form.
I simply want to drop the contents of the edit box into a field on the
sub form when the users click the button. But I can find nothing in the
documentation or online with an example of how to do this.
This happens to be an "Access Data Project" (.adp) connected to SQL.
However, I think even a .mdb based example would be a huge help.
FYI, here is what I attempted, but I get an error on the new record
part:
<BEGIN CODE>
Private Sub Btn_AddRelationship_Click()
Me.EditBox.SetFocus 'Avoids an access error when not the
focus
Me.MySubForm.Form.NewRecord
Me.MySubForm.Form.Recordset("tMyTextField") = Me.EditBox.Text
End Sub
<END CODE>
Thanks in advance for any help!
I have a form with some data that has a subform with some related data.
I have an edit box and a command button on my main form.
I simply want to drop the contents of the edit box into a field on the
sub form when the users click the button. But I can find nothing in the
documentation or online with an example of how to do this.
This happens to be an "Access Data Project" (.adp) connected to SQL.
However, I think even a .mdb based example would be a huge help.
FYI, here is what I attempted, but I get an error on the new record
part:
<BEGIN CODE>
Private Sub Btn_AddRelationship_Click()
Me.EditBox.SetFocus 'Avoids an access error when not the
focus
Me.MySubForm.Form.NewRecord
Me.MySubForm.Form.Recordset("tMyTextField") = Me.EditBox.Text
End Sub
<END CODE>
Thanks in advance for any help!