Help with VBA Syntax

S

SteveSanDiego

I have created a form that draws data from an assignment table that have a
Contact field and a Contact Type field. . I can filter for Contact Type if
i use the command

Private Sub cboFindRelationship_Change()
Me.Filter =
"RelationshipType=forms!frmContactAssignmentSub!cboFindRelationship"
Me.FilterOn = True
End Sub

When I put this form in another form (Company) as a subform it does not
work. I am trying to figure out the syntax to make this work?

Can you help?
 
S

Steve Schapel

Steve,

Probably, you need like this...
Me.Filter =
"RelationshipType=Forms!Company!frmContactAssignmentSub.Form!cboFindRelationship"

However, if the cboFindRelationship in the Filter expression is the same
as the cboFindRelationship that is triggering the action, you could do
it like this...
Me.Filter = "RelationshipType='" & Me.cboFindRelationship & "'"
 

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