Invalid form property Function call

B

brianpowers27

I have created an .adp in Access 2007. I have created 2 main forms.
The first form (search criteria)builds the recordset and sql based
upon the fields the user fills in, the second (frmsashsearchresults2)
handles the results of the search. I created a subform on the search
results form which displays the same information as the parent form
but in a datasheet.

When I created the subform I decided that I would need to pass the
recordset from the parent and link according to the item no. I then
created a public sub called rstTransfer. This sub is designed to copy
the recordset of the parent to the subform.

Public Sub rstTransfer()
Dim rst2 As adodb.Recordset
Set rst2 = Me.Recordset
Set Me!frmSashSearchResultsSubForm.Form.Recordset = rst2
rst2.Close
End Sub

When I try to call this method from the search form using the
following code. It fails most of the time with the message invalid
form property.

Forms!frmsashsearchresults2.rstjob

I am confused because I have recieved several different errors as I am
troubleshooting this error and have found that occasionally the code
works. I know that the code will work properly when it is executed
directly from the frmsashsearchresults2 form within a button click.
 
Top