Cardbox > Forums > Macros and Programming > "Help with MACRO"
Help with MACRO
Posted By | Post |
---|---|
SHopkin | 10-Nov-2009 12:36 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 : 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 Any help gratefully received |
bert | 10-Nov-2009 17:14 Try this: x = Fields("COMPANYNAME") You can also make the selection into a new window: Success |
SHopkin | 10-Nov-2009 17:57 Thank you Bert. Is there any way of just selecting & using the first two words in the field (hence eliminating variations such as Ltd & Limited) |
bert | 10-Nov-2009 18:44 x = Fields("COMPANYNAME") & " " 'COMPANYNAME + two spaces in case there is only one word Have attention: this macro does not support punctuation in a name! regards |
SHopkin | 11-Nov-2009 11:33 Bert - you are a superstar ! You've enabled us to make a huge bound in enhancing the value we get out of Cardbox ! If you are ever looking for paid consultancy I would like to talk further. Kind regards, |