how to open by default a subform to same ID of master form?

H

HGood

Hi, I have a many to many database where a Project can have more than one
Language, and the Language can also exist in more than one Project. Left and
right arrows on the subform allow me to click thru the various Projects it
(the Language) is part of.
There are two criteria on the master form to which I'd like the subform
to open by default. The primary one is EthID, which is presently linked to
ctrlEthID on the main form. So it correctly opens by default to the EthID.
However, there's also another ID on the subform (StageProjectID) that I'd
like to have the subform open by default - to be the same as the ProjectID on
the main form. I tried linking Child to Master, but then it doesn't allow me
to click thru the other Projects that is part of.
TIA for anyone that can tell me how to have it meet this second criteria
for default opening, so that it will open to both the same EthID and same
ProjectID as on the main form. It's probably some VBA code. If it is VBA
code, which of the two forms do I place it in, Main or Sub? Also, which
event? Maybe I should have posted this over in programming.
Thanks very much, Harold
 
S

shanesullaway via AccessMonster.com

Hey Good,

I "think" I'm right on this but you should be able to go to the Master/Child
on the subform and put this:

Master: ctrlEthlID;ProjectID
Child: EthlID;StageProjectID

Hope I got the control names right and I have the Mainform and subform
controls correctly. I think this will accomplish what your trying to do.

HTH,
Shane
 
H

HGood

Hi Shane, thanks for the response. This is what I tried as described below
(and just now tried again), it does work, but then it locks it there and
doesn't allow me to use the arrows in the subform to click thru the various
projects this language is part of. I think that second linkage of ProjectID
prevents this.
I think it likely requires VBA code to get it there by default upon
opening, but then free it up so users can click thru the projects.
But I do appreciate you having given it some thought. Harold
 
Top