Please help with multiple field Link Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Form_1 contains cbo_Application_Acronym and a subform containing
DataElement_Name. Form_2 is 'keyed' by Application_Acronym and
DataElement_Name.

From the subform, I want to link to Form_2 using both fields. Here is the
code for stLinkCriteria:

stLinkCriteria = "[DataElement_Name]=""" & Me![DataElement_Name] & _
""" And [Application_Acronym] = "" &
Me.Parent.Form![cbo_Application_Acronym] & """

The syntax for this string absolutely baffles me. I ran the debugger.
Me![DataElement_Name] has the right value and
Me.Parent.Form![cbo_Application_Acronym] has the right value.

But Access prompts for input of Application_Acronym.

Help!!! Please.
 
It looks like you are missing a double quote after
.... """ And [Application_Acronym] = "" & ....

should look like

.... """ And [Application_Acronym] = """ &....


You could also add a line:

Debug.Print stLinkCriteria


Step thru the code and look at the immediate window to see if the
'stLinkCriteria' is what you want.

You might also try:

Me.Parent![cbo_Application_Acronym]


HTH
 
Back
Top