NetTalk Central

Author Topic: Problem with lookup value  (Read 3322 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Problem with lookup value
« on: March 01, 2012, 07:39:46 AM »
I am not quite sure how to explain this but will try.

I have a Contact record which has a key of fullname. I have a related record Patient which has to store the Contact GUID. Pretty standard stuff so far.

So on the Patient form I have a button to Select a Contact. The lookup settings are as shown.

All works perfectly until I add a Contact with no First Name. Here is what happens:

I select the Contact. The Contact name is entered successfully. In Complete Form I show Pat:ContactGUID which is correctly shown. However, when the Patient record is actually saved it is saving the Fullname in the patient Contact GUID field.

To me that makes no sense. But the way to correct this is to enter a First Name.

Because FullName is made up of First Name + space + LastName I am assuming that the preceding space is the issue here.

If this makes sense can anyone explain why this is happenignnand what can be done.

Thanks

John

[attachment deleted by admin]

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Problem with lookup value
« Reply #1 on: March 01, 2012, 03:20:12 PM »
space is possibly a prob on a key

try FullName = left(First Name + space + LastName)

lanmicro

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Email
Re: Problem with lookup value
« Reply #2 on: March 02, 2012, 12:40:14 PM »
try

FullName = left( clip( First Name ) &' '& LastName )

or

if FirstName = ''
  FullName = LastName
else
  FullName = left( clip( First Name ) &' '& LastName )
end
Gregory C. Bailey