We have a file which we use to keep all our customers contacts listed so we frequently have several records for one company (as we have multiple contacts for each company) I have tried to create a macro which selects all the contacts for one company in one go eg: If we are looking at a record for Joe Bloggs at British Midland it will find all the contacts for British Midland
I have tried :
ActiveWindow.Select "COMPANYNAME","""BRITISH MIDLAND MAINTENANCE HANGER"""
But this unfortunately keeps pasting the same Company name into the macro. This example also would be better to just select on the first two words of a company name ie British Midland
x = Fields("COMPANYNAME") & " " 'COMPANYNAME + two spaces in case there is only one word
y = split(x," ") 'place all terms in an array - you need first two for selection
'you got them because the added spaces
ActiveWindow.Select "COMPANYNAME","""" & y(0) & " " & y(1) & """" 'use first two term of the array.
Have attention: this macro does not support punctuation in a name!
If you want to support punctuation it is better to use SelectData command. Use right parameters - look in the Cardbox Help for it. This is a little slower, but I think fast enough.