T
Toucan
Dear all.
I have a form with memo fields and it contains a subform with buttons to
insert boilerplate text into the fields in the parent form.
If the button were in the same form as the memo field, this code would work:
Private Sub Command1_Click()
Dim ctl As Control
Set ctl = Me.Field1
DoCmd.GoToControl ctl.Name
Field1.Text = Field1.Text & " " & "test text"
End Sub
But I can't get it to work from the subform. This is what I have so far:
Private Sub Command0_Click()
Dim ctl As Control
Set ctl = Forms!Form1
DoCmd.GoToControl ctl.Name
Me.Field1.Text = Field1.Text & " " & "test text"
End Sub
Any thoughts?
Toucan
I have a form with memo fields and it contains a subform with buttons to
insert boilerplate text into the fields in the parent form.
If the button were in the same form as the memo field, this code would work:
Private Sub Command1_Click()
Dim ctl As Control
Set ctl = Me.Field1
DoCmd.GoToControl ctl.Name
Field1.Text = Field1.Text & " " & "test text"
End Sub
But I can't get it to work from the subform. This is what I have so far:
Private Sub Command0_Click()
Dim ctl As Control
Set ctl = Forms!Form1
DoCmd.GoToControl ctl.Name
Me.Field1.Text = Field1.Text & " " & "test text"
End Sub
Any thoughts?
Toucan