drmaestro

Cannot link 2 layouts using a button

Discussion created by drmaestro on Oct 1, 2017
Latest reply on Oct 1, 2017 by drmaestro

Hi, I am trying to create a medical imaging database. I have 2 different layouts (tables). The first one is for patient records and has a patient ID key generated automatically for each record (primary key). Some patients (not all of them) might have 1 or more pathological findings found on their examination. If the patient has a finding, I want to click a button to go to the second layout (table) which has some fields that will need to be completed by the user (like the size, location and the type of the pathology) but it also needs to copy Patient ID, patient name and date from the first table so that there is a relationship between the tables. So what I did was to create 2 layouts, each one containing the Patient ID field and created a relationship between them on the database management options. The name and date fileds on the second table are looked up from the first table. My problem is with the programming of the button script:

1) I start by the Go to Layout command to change the layout: It works without a problem.

2) I add a New Record / Request command to add a new record to the second layout: It also works and creates a new record.

3) I try different options to get the patient ID from the first record and paste it to the second layout's patient ID field: It fails. It doesn't copy that value. It is either empty but editable or empty and non-editable, depending on which commands I use.

What is the required script to make that button as it should?

Thanks.

Outcomes