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

G

George

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>
 
S

Sprinks

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
 
O

Ofer

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

George

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

George

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