stLinkCriteria

  • Thread starter Thread starter Walter
  • Start date Start date
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
 
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
 
Back
Top