Passing Form as Openarg

Hi,
Runnung MS Access 2013, Windows 7.

I want to pass a form name as an openarg when opening a pop-up form, then access the recordsetclone of the passed form.
In the main form I call the pop-up as follows:
DoCmd.OpenForm "frmClientSearchResults", , , , , acDialog, Me.Name 'open the pop-up form

Open in new window


In the pop-up form one of the routines tries to do the following, but I'm getting a compile error "invalid use of property" on the second line (CallingForm = Me.OpenArgs)
Dim CallingForm As Form
CallingForm = Me.OpenArgs
With CallingForm.RecordsetClone
    .FindFirst "[client_id]=" & Me.client_id
    If .NoMatch Then
        MsgBox "Client not Found"
    Else
        CallingForm.Section(0).Visible = True
        CallingForm.Bookmark = .Bookmark
    End If
End With

Open in new window


Can anyone help please?
redpoppyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GozrehCommented:
Set CallingForm = Forms(Me.OpenArgs)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
redpoppyAuthor Commented:
Wow, that's the fastest response I've ever had and it sorted my problem Thanks for such a quick answer, much appreciated
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.