open form from subform control

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Scott,

Try:

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

HTH,
Nikos
 
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
 
Back
Top