Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5732 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am setting up a database for a small doctors office. Right now i am working on the client management table and layout. I would like to create a dropdown menu that has all the last names of the patients ans when you select a patient it switches the current record to that patients record. Does anyone know how to accomplish this?

Posted

Welcome to FM Forums!

It should be simple using script trigger OnObjectModify[] so it will fire upon data change selection in the drop-down. Normally I'd suggest using the PatientID instead of last name so that the jump is to a specific patient because, if there are more than one Mr. Brown, only one will show in the value list and you won't know which one.

But you might have more than one William Brown as a patient as well, so you'd have to include city or some other unique designator in the value list. Because of this possible duplication of unique patients, using last name would work better and, if there is more than one resulting patient, provide the User with a list (which shows details about the patients) for the User to select further.

Your value list would be called All Patients and you would select 'from values from field' and 'all values' and you would select the LastName field in the left side. There is no need to display anything else. Attach this value list to a gLastName (global text field explained in next paragraph). YOu can also attach 'auto-complete' to this drop-down.

There are two ways to jump: GTRR ( Go To Related Record ) and Perform Find. Since this will be a simple find involving only the current table and since LastName can be indexed, I would keep it simple and perform a find. Create a global text field called gLastName and attach your value list to it.

Script attached would be (and this process is untested):

Set Error Capture [ On ]

Enter Find Mode [ ] [color:gray]uncheck pause and uncheck restore

Set Field [ Patients::LastName ; gLastName ]

Perform Find [ ]

If [ not Get ( FoundCount ) ]

Show Custom Dialog [ "No records found" ]

Exit Script

End If

[color:gray]... records found. If only 1 record found, go directly to patient chart layout otherwise, go to a list which shows patient's LastName, FirstName, Address (and anything else which would make it simple to select the exact patient). Have a button on the row to jump then to that patient's chart.

If [ Get ( FoundCount ) = 1 ]

Go To Layout [ Patient Chart ]

Else

Go To Layout [ List layout ] so user can select specific patient

End If

This topic is 5732 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.