N
Nick Stansbury
See this post for background info (similar problem):
http://groups.google.co.uk/group/mi...eport"+subform&rnum=74&hl=en#93801a080cbe4404
I experienced a similar problem to the author of the above post. I
dynamically load the source object for a subform in code. Here is an
example:
Public Sub PopulateSubForm(MySubFormControl As SubForm)
Dim MyRS As ADODB.Recordset, MySubForm As Form, MySubformSourceObject As
String, MyIPname As String
MySubFormControl.SourceObject = "BLAHBLAH"
Set MySubForm = MySubFormControl.Form
'Build a recordset from a call to the remote sql server here....
Set MySubForm.Recordset = MyRs
End Sub
This line of code - [ Set MySubForm = MySubFormControl.Form ] was throwing a
sporadic run time error : "You entered an expression that has an invalid
reference to the property Form/Report"
The error was sporadic. There seemed to be no common factors accross the
various occurences. Most times clicking into the sub form and then
re-populating it would work - but not always. Moving to the next record (as
in the post above) would resolve the problem, sometimes. Decomiple, compact
/ repair, recreate references, revert to back up - none of it helped.
However the following did :
SOLUTION -> Setting the focus to the subform container fixed the problem - I
added "MySubFormControl.SetFocus" immediately after setting the source
object and the problem went away.
Weird. Hope that this post means someone else can spend less time on this
problem than I did.
Nick
http://groups.google.co.uk/group/mi...eport"+subform&rnum=74&hl=en#93801a080cbe4404
I experienced a similar problem to the author of the above post. I
dynamically load the source object for a subform in code. Here is an
example:
Public Sub PopulateSubForm(MySubFormControl As SubForm)
Dim MyRS As ADODB.Recordset, MySubForm As Form, MySubformSourceObject As
String, MyIPname As String
MySubFormControl.SourceObject = "BLAHBLAH"
Set MySubForm = MySubFormControl.Form
'Build a recordset from a call to the remote sql server here....
Set MySubForm.Recordset = MyRs
End Sub
This line of code - [ Set MySubForm = MySubFormControl.Form ] was throwing a
sporadic run time error : "You entered an expression that has an invalid
reference to the property Form/Report"
The error was sporadic. There seemed to be no common factors accross the
various occurences. Most times clicking into the sub form and then
re-populating it would work - but not always. Moving to the next record (as
in the post above) would resolve the problem, sometimes. Decomiple, compact
/ repair, recreate references, revert to back up - none of it helped.
However the following did :
SOLUTION -> Setting the focus to the subform container fixed the problem - I
added "MySubFormControl.SetFocus" immediately after setting the source
object and the problem went away.
Weird. Hope that this post means someone else can spend less time on this
problem than I did.
Nick