Calling a function - can someone please tell me where I'm going wrong?

Calling a function - can someone please tell me where I'm going wrong?

Hi

I currently have a problem calling a function from another application and getting it to set a variable value in a second application. Any guidance would be much appreciated.

Here's the scenario...

'dbs' is my lookup application.

I have created a function in the 'dbs' application, called 'ClientID', to fetch the 'Client_Name' field from the 'clients' form - used the following code:

string ClientID(string ClientName)
{
    rec  =  clients  [ID != 0];
    return rec.Client_Name;
}


'submissions' is another application that has a form containing a lookup field called 'clientlookup', and the application in which I need to reference the associated client name from the 'dbs' application. The lookup field displays the client's name when shown in reports but shows the ID when referenced in any 'sendmail' code - which is no good to my end users as they need to see the client's proper name.

In the submissions application, I try to set the variable x using the following code:

x = dbs.ClientID (ID == input.clients);

(on saving this code, however, the error "Mismatch data type for function 'ClientID' at argument 1 expected type STRING found data type BOOLEAN)

Please can you advise me as to which bit I've got wrong and why? Ideally, quoting the code that I should be using for both the function and the code to call the function to return the Client_Name field value as the variable.

Many thanks in advance for your reply.