J
Jen
....well, complicated to me at least!! (I have x-posted this to another non-MS
forum, so I apologize if you've already seen it).
I have a form (Form1) that contains a subform (Subform1). The subform is in
datasheet view, and I want to add a new field to it that holds notes - a memo
field. This won't work well in datasheet view...I want to be able to make the
box bigger so I can see a lot of its contents at once. So, I want to add
another box onto the main form that shows the notes associated with the
currently selected record in Subform1.
So basically, what I think I want is Form1, with Subform1 in datasheet view,
and another subform (Subform2) showing the notes associated with the current
record in Subform1. [Note: at first I did this using a popup form for the
Notes field, which worked fine, but we decided it would be preferable to have
it as a box on Form1.] Not sure if it's clear from the above explanation, but
Subform1 and Subform2 both have the same table as their datasource.
I'm pretty sure I need to use the OnCurrent event of Subform1 to make the
contents of Subform2 change as the selected record is changed. The problem
I'm having is that I can't get the syntax right for referring to Subform2. My
code on OnCurrent for Subform1 was:
Private Sub Form_Current()
Me![Subform2].Form!mmoNotes.Requery
End Sub
I also tried .Refresh but neither works. I was getting a syntax error when I
try to open Form1.
I read another couple of articles and tried this:
Private Sub Form_Current()
Forms!Form1![Subform2].Form!mmoNotes.Requery
End Sub
And now I'm getting a different error - "Run-time error '-2146500594
(8000f000e)': Method 'Form' of object '_Subform' failed.
Any suggestions or advice on how best to do this would be much appreciated.
I haven't done much work with subforms other than basic form-subform pairs,
so this is a bit new and confusing for me.
Thanks!!
Jen
forum, so I apologize if you've already seen it).
I have a form (Form1) that contains a subform (Subform1). The subform is in
datasheet view, and I want to add a new field to it that holds notes - a memo
field. This won't work well in datasheet view...I want to be able to make the
box bigger so I can see a lot of its contents at once. So, I want to add
another box onto the main form that shows the notes associated with the
currently selected record in Subform1.
So basically, what I think I want is Form1, with Subform1 in datasheet view,
and another subform (Subform2) showing the notes associated with the current
record in Subform1. [Note: at first I did this using a popup form for the
Notes field, which worked fine, but we decided it would be preferable to have
it as a box on Form1.] Not sure if it's clear from the above explanation, but
Subform1 and Subform2 both have the same table as their datasource.
I'm pretty sure I need to use the OnCurrent event of Subform1 to make the
contents of Subform2 change as the selected record is changed. The problem
I'm having is that I can't get the syntax right for referring to Subform2. My
code on OnCurrent for Subform1 was:
Private Sub Form_Current()
Me![Subform2].Form!mmoNotes.Requery
End Sub
I also tried .Refresh but neither works. I was getting a syntax error when I
try to open Form1.
I read another couple of articles and tried this:
Private Sub Form_Current()
Forms!Form1![Subform2].Form!mmoNotes.Requery
End Sub
And now I'm getting a different error - "Run-time error '-2146500594
(8000f000e)': Method 'Form' of object '_Subform' failed.
Any suggestions or advice on how best to do this would be much appreciated.
I haven't done much work with subforms other than basic form-subform pairs,
so this is a bit new and confusing for me.
Thanks!!
Jen