M
MarkusJohn
I have a form.. in the header there are unbound search fields. The
entered values are concatenated to a string. When you press the filter
button in the form all the found entries appear.
The searchable fields are not only based on one table.
In my case I have the tables order and customer. primary keys for order
is order no and for customer custid. When I created the form I used the
wizzard and selected all required fields. But when I look for a
customers name the realtion order customer is not linked over name but
id. So I get for the name only one result or a mistake.
What I want is all Peter´s for example.
So my question how can I execute in a query in my vba code? DBLookup
works but results only one person..
Here´s a snippet of my code:
If Not IsNull(Me.TxTName) Then
id = 0
id = DLookup("[KundenID]", "Customer", "[Name] = '" &
Me.TxTName & "'")
strWhere = strWhere & "([CustomerID] = " & id & ") AND "
End If
entered values are concatenated to a string. When you press the filter
button in the form all the found entries appear.
The searchable fields are not only based on one table.
In my case I have the tables order and customer. primary keys for order
is order no and for customer custid. When I created the form I used the
wizzard and selected all required fields. But when I look for a
customers name the realtion order customer is not linked over name but
id. So I get for the name only one result or a mistake.
What I want is all Peter´s for example.
So my question how can I execute in a query in my vba code? DBLookup
works but results only one person..
Here´s a snippet of my code:
If Not IsNull(Me.TxTName) Then
id = 0
id = DLookup("[KundenID]", "Customer", "[Name] = '" &
Me.TxTName & "'")
strWhere = strWhere & "([CustomerID] = " & id & ") AND "
End If