G
Guest
2003/XP/Novice
Good Evening
When I open my form, the first line of code below puts a Select query into
the rowSource of a list box on the subform: fsubSelectRecord. This works OK.
Private Sub Form_Open(Cancel As Integer)
Me!fsubSelect.Form!lstSelectRecord.RowSource = "qrySelectPageOrder"
'make the combo the same as the destination
Me.cboLocalDestination = Me!LocalDestinationID
'prevent the "The OLE object is empty" error message
'by setting focus on a control on the main form
Me.cboLocalDestination.SetFocus
'Me.Refresh
Me!fsubSelect.Form!lstSelectRecord.Requery
End Sub
When I close the form, the line of code below is supposed to remove the
query from the RowSource.
Private Sub Form_Close()
Me!fsubSelect.Form!lstSelectRecord.RowSource = ""
End Sub
But I get the error:
Run time error '2445'
You entered an expression that has an invalid reference to the property
Form/Report.
I am want to null the RecordSource because the subform is used with multiple
forms and I load a different query with each form.
Thank you
Peter
Good Evening
When I open my form, the first line of code below puts a Select query into
the rowSource of a list box on the subform: fsubSelectRecord. This works OK.
Private Sub Form_Open(Cancel As Integer)
Me!fsubSelect.Form!lstSelectRecord.RowSource = "qrySelectPageOrder"
'make the combo the same as the destination
Me.cboLocalDestination = Me!LocalDestinationID
'prevent the "The OLE object is empty" error message
'by setting focus on a control on the main form
Me.cboLocalDestination.SetFocus
'Me.Refresh
Me!fsubSelect.Form!lstSelectRecord.Requery
End Sub
When I close the form, the line of code below is supposed to remove the
query from the RowSource.
Private Sub Form_Close()
Me!fsubSelect.Form!lstSelectRecord.RowSource = ""
End Sub
But I get the error:
Run time error '2445'
You entered an expression that has an invalid reference to the property
Form/Report.
I am want to null the RecordSource because the subform is used with multiple
forms and I load a different query with each form.
Thank you
Peter