Pass value from a parent form, to a pop-up form

G

Guest

Hi folks,

Looking for some help on this. I have a clients form which displays
properties owned by a client. I have a button that a user clicks to add a
new property to the current client's portfolio.

My question is: How do I pass the clientID (primary key) to the child form,
so that the clientID can be stored as the owner of the asset in the assets
table>
 
G

Guest

George,

The ClientID will be automatically recorded for the RecordSource of the
subform if you have set the LinkMasterFields and LinkChildFields properties
of the subform to the name of the ClientID field in the main form and
subform's RecordSource, respectively. You needn't, however, include a
control to *display* it in either the main or subform, however.

Sprinks
 
G

Guest

Are you trying to pass a value to another form?
If so, use the OpenArgs in the open form command line

docmd.OpenForm "FormName",,,,,,Me.clientID

On the OnLoad event of the second form you can use it
Me.clientID = Me.OpenArgs

the Me.OpenArgs will return the clientID
 
G

Guest

Ofer you beauty!

That fixed it for me, had thought that the openArgs part of openForm might
be able to help me, hadn't looked in to it though.

Many thanks for yours and Sprinks' time
 
G

Guest

PS, will mark as "Answered" when I get home tonight. Work PC is locked down,
ActiveX disabled.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top