Please help with multiple field Link Criteria

J

JHC

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.
 
S

Steve Sanford

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
 

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