open form from subform control

G

Guest

Hi all,

i have searched for this problem and found quite a few various different
answers, but the not one i want:

DoCmd
"ViewJobDetailsFrm",,,"JobNo=Forms!ViewJobsByCust!SearchJobsFrmSub.Form!JobNo"

I have tried various different ways of getting this to work but no luck

SearchJobsFrmSub is the subform within ViewJobsByCust, the subform is
continous and list all the jobs done by customer with a command button to
open a main form called ViewJobDetailsFrm based on the value of JobNo.

I just can't get the referencing right for the subform control

Many thanks for any help

Scott
 
N

Nikos Yannacopoulos

Scott,

Try:

DoCmd.OpenForm "ViewJobDetailsFrm", , , _
"JobNo=" & Forms!ViewJobsByCust!SearchJobsFrmSub.Form!JobNo

HTH,
Nikos
 
G

Guest

Thanks for the ultra quick reply, that works.

But i feel that if i had of looked at the names of my controls more closely
it would have worked the first time round, your line of code generated a
different error to the others that i have seen which made look at the name of
subform control name.

I didn't realise it had changed the name, but there we go, it works now!

Many thanks
Scott
 

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

Top