stLinkCriteria from a subform

MartynE

Registered User.
Local time
Today, 15:04
Joined
Mar 27, 2013
Messages
49
I've been thinking and trying on this for over 6 hours and yet I think the solution is simple.
Problem is that I have to print a PDF and use that file to email it to the corresponding email. Everything works fine except this one little thing.
The thing is that the stLinkCriteria won't recognize the linking field cause it's in a sub-form. So it keeps asking to fill in the parameter by hand.
I think I tried a lot of variaties, if the linking field isn't in a sub-form there is no problem to get it to work.
So what am I missing here, is it even possible to get it out of a sub-form?

info: form: [IK09:Subbestelbon]
sub-form: [IK09A:Prijsaanvragen]
linking field: [AANVRAAG_ID] which is on the sub-form

Here is one of the versions I tried but did not work.
Code:
    stLinkCriteria = "[IKSUB_PRIJSAANVRAGEN].[AANVRAAG_ID]=Forms![IK09A:Prijsaanvragen]![AANVRAAG_ID]"
    Call Printen_LadePdfsav("IK09:PrijsaanvraagPDF", stLinkCriteria)
 

Attachments

  • stlinkcriteria.jpg
    stlinkcriteria.jpg
    88.9 KB · Views: 124
I think the way you refer the SubForm is not correct.. It should be..
Code:
Forms![IK09:Subbestelbon]![IK09A:Prijsaanvragen].Form![AANVRAAG_ID]
For a detailed description on how to refer to Form controls refer to this site..
 
Forms![IK09:Subbestelbon]![IK09A:Prijsaanvragen].Form![AANVRAAG_ID]

That was the one word I was missing, You don't wanna know how many varieties I tried :p.
Thanks again!
 

Users who are viewing this thread

Back
Top Bottom