Multiple Field Matching with Macro

tellsi

New member
Local time
Today, 06:11
Joined
Jun 13, 2007
Messages
2
Hi

I want to have a form where i use a click button to open a new form which will then match all fields to narrow down the results.

The standard function only uses one matching point I tried more but it does not work:
Private Sub Command24_Click()
On Error GoTo Err_Command24_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "RECAP"

stLinkCriteria = "[ISIN]=" & "'" & Me![ISIN:] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command24_Click:
Exit Sub

Err_Command24_Click:
MsgBox Err.Description
Resume Exit_Command24_Click

End Sub
There are a total of 5 fields.

Thanks for the help. If you need more info i happy to provide. I am new to proramming so dont know what to leave behind!!!!
 
stLinkCriteria = "[ISIN]=" & "'" & Me![ISIN:] & "' and [ISIN2]=" & "'" & Me![ISIN2:] & "' and [ISIN3]=" & "'" & Me![ISIN3:] & "'...
 
stLinkCriteria = "[ISIN]=" & "'" & Me![ISIN:] & "' and [ISIN2]=" & "'" & Me![ISIN2:] & "' and [ISIN3]=" & "'" & Me![ISIN3:] & "'...

thanks for the quick reply. I tried it and returned the following error:
Object doesn't support this property or method

my codeing line:
stLinkCriteria = "[ISIN]=" & "'" & Me![ISIN:] & "' and [Quantity]=" & "'" & Me![Quantity:] & "' and [Market]=" & "'" & Me![Market:] & "' and [Side]=" & "'" & Me![Side:] & "'"
 
I am not sure if that has an impact on it, but I don't understand the use of the column «:» in your fields.
 

Users who are viewing this thread

Back
Top Bottom