stLinkCriteria

W

Walter

How do I write the criteria(stLinkCriteria = ) to link the
main form's Primary key control to a subform with the same
control on it which is being opened with a command button
on the main form.
stDocName = "SubformName"
stLinkCriteria = ?
Thanks,
Walter
 
J

John Vinson

How do I write the criteria(stLinkCriteria = ) to link the
main form's Primary key control to a subform with the same
control on it which is being opened with a command button
on the main form.
stDocName = "SubformName"
stLinkCriteria = ?
Thanks,
Walter

The link criteria is a valid SQL WHERE clause without the word WHERE.
So if the subform is based on a Query or Table with a field named
MyID, and the mainform is displaying its Primary Key in a textbox
named txtID, and that field is numeric you would use

strLinkCriteria = "[MyID] = " & Me!txtID
 

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