Changing a subform link critiera to display a new form

C

Christine

I have a form where the user can select a field's value
from a Combo Box to search by. When they make the
selection, a subform (Default view = Continuous Forms)
updates to show the records that meet the search
criteria. To do this, the subform's source object is
linked to the form where the search is made: the child
and master fields are equal. This works a treat: all the
records that meet the search criteria are displayed.

In the subform, I want the user to be able to double-
click on the ServiceNum field (or a command button) that
will take them to the detail record for that ServiceNum
on another form. Thus, the following code:

Dim stLinkCriteria As String

stLinkCriteria = "[ServiceNum]=" & Me![ServiceNum]
DoCmd.OpenForm "frm Disposition Service", , ,
stLinkCriteria

When I do this, the following message appears: "

"The expression On Click you entered as the event
property setting produced the following error: A problem
occurred while Microsoft Access was communicating with
the OLE server or ActiveX control. *The expression may
not result in the name of a macro, the name of a user-
defined function, or [Event Procedure]. *There may have
been an error evaluating the function, event, or macro."

At this point, it won't even let me look at the Watch
window to see what's happening.

What does the error message mean, and how can it be
corrected? (I don't necessarily want to limit the records
to the ServiceNum - it would be nice to just go to that
particular record and let users cruise. When done, they'd
hit the Exit button and return to the original form.
However, I'd be happy just to get them to the ServiceNum
they originally looked for.)

Thanks in advance,
Christine
 

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