Use a calcualtion field to combine first and last name in a single field and specify text as the return type.
The simplest approach (not necessarily the best), is to define your value list to list PatientID--this should be an auto-entered serial number, as the first field (Primary field) and the calculation field that combines first and last names as the secondary field. This allows you to use the name to select a patient, but the ID number is what is entered into the field when you select a value from this value list.
More sophisticated approaches are possible such as the method in this demo file, but require scripting to handle all the issues involved.
This demo file allows you to use an auto-complete enabled value list of names for selecting a record, but scripts both look up and enter the corresponding ID number and also handle situations where two or more records have identical names.
FileMaker 12 users: https://dl.dropbox.com/u/78737945/SimpleNameLookupDemo.fmp12
Pre FileMaker 12 Users: https://dl.dropbox.com/u/78737945/SimpleNameLookupDemo.fp7
I tried the 'simplest approach' you mentioned. Initially it appeared to work, but:
a) When the pop-up was used, it failed to change the Firstname, Lastname fields and
b) I found that the PatientID in table view was changed to drop-down text and that the ID numbers were changing.
Hence I put the example files on drop-box for people to see what was happening.
a) why are there first name and last name fields to change? If you need to put them on your layout, you should include them as related fields from the original table. Then, if your relationship is based on the ID number, selecting a name from the value list autmatically displays data, such as the names, from the related table.
b) This doesn't sound like you have the correct field set up with the value list format, or you have the wrong field specified as the primary field in your value list set up.
Your download link doesn't work until you add ?dl=1 to the end of it. In looking at it. On which layout do you want to use this value list? And what result do you want to see. Using it on the Patient layout doesn't really make sense unless you want to use this drop down to find a patient's patient record. And the value list defined in this file does not match what I am describing for you.
Please spell out exactly how you want to use this drop down and then I will respond with instructions in terms specific to the file you have shared via Drop Box.
I wanted to be able to:
1. Enter new patient records on the Patient layout
2. From the 'Patient' (fullname) popup switch between patient records and
3. Pull up their Prescriptions and Records via portals. I could then enter new Prescriptions/Records from the portals.
Is that adequate as an explanation of requirements?
Let's stay focused on your pop up. You want to use this field to FIND an existing Patient record.
You need to add a new field for this purpose as you don't want using this popup to alter the ID or name of the current Patient Record.
Go to manage | Database | Fields and add a number field and specify global storage in field options for it. This field may be defined in any table. I often add an extra table just for such global fields. We'll call this field, gSelectPatientID.
Format this field with a value list where PatientID is the primary field and your full name calculation field is the secondary field.
Now write a script that uses the value selected in this field to find a patient record:
Enter Find Mode  ---> clear the pause check box
Set Field [Patient::__PatientID ; GlobalFields::gSelectPatientID ] ---> gSelectPatientID must have global storage specified or this won't work.
You can perform this script by adding a button next to the pop up formatted copy of GlobalFields::gSelectPatientID or you can use a Script Trigger. OnObjectModify works well with popup menu, radio button and checkbox formats. OnObjectSave works better for Drop Down List formats. Then, when you select a patient from this value list, the script will automatically find that record and display it.
Is there something missing from:
Enter Find Mode  ---> clear the pause check box
Set Field [Patient::__PatientID ; GlobalFields::gSelectPatientID ]
because the enable button isn't active. ie. do I have to specify in the [ ] for the 1st/ 3rd lines?
enable button??? what's that?
The brackets shown as empty should be left empty.
Apologiies, it's now a GIF. See screen capture
What file format did you try to upload for your screen capture? Only jpg, gif or png files may be uploaded directly to the forum. All other formats such as the actual database file or a PDF, would need to be uploaded to a FileSharing site such as Drop Box and then the download link may be posted here.
On the other hand, sometimes you upload an image file of the correct type and it doesn't appear with the posted message until after a large delay, so I may see your screen shot after I post this message and the screen refreshes. (I've been reloading the page off and on for quite a while before posting this...)
I've replaced with a GIF
You have FileMaker Advanced. The enable/disable button is used to enable or disable a selected script step as part of debugging and design tests. It's a way to "turn off" a script step without deleting it from the script.
It has no bearing on this script as we want all the script steps to be enabled.
OK I've assiged the script with an 'onobjectmodify' trigger. When I now use the popup all the 'Patient' fields switch to find mode. I don't yet see how this helps.....I was hoping that the Patient fields would 'follow' the popup selection.
Better check your script again. Sounds like you either have the wrong step or have
Enter Find mode [pause]
when you should have:
Enter Find mode 
The script should find the patient record using the info selected in the pop up menu.
Script appears as you wrote it with no pause. However, as suggested I did put the global field in a global table. The latter is not related, in the relationship diagram, to Patients. It's the first time I've used a global field there not sure of the 'relationship rules'. I've put the file on DropBox