Refer to the detail section of a subform from another pop-up

liddlem

Registered User.
Local time
Today, 16:36
Joined
May 16, 2003
Messages
339
I have a 'master' navigation form called 'NPYWC'
On it, there is a subform called 'patient' - this has a number of subforms in the detail section (Linked on a one-to-one key).

When the patient form loads, I hide the detail section until a user either
A. Finds an existing client record or
B. Clicks the 'ADD NEW' button

The ADD NEW button opens a separate (pop up) form where the primary patient information is gathered.
When the user clicks "Save" on the pop up, my VBA script ...
A. Creates all the one-to-one relationships that are required.
B. Updates the 'Find Patient' field to the newly created patient number
C. Finds the new record
D. Un-hides the detail section (This is what I cant get to work)

I have tried a number of things. The latest being
Forms![NPYWC]![NavigationSubform].Form![Section].[Detail].Visible = True

Can anyone help me with the correct syntax please?


PS. The rationale for hiding the detail section in the first place?
The answer is twofold.
1. If the user simply creates an new patient, the three actions (A, B C above) don't always run/display the data properly. (Im not sure why? ) The pop up form seems to be a good working solution for me.
2. My users have a tendency to change data on the default patient. I have tried going to new record, but then they add new (often duplicate) patient records.
 
I think you need to fix the problem, personally. You can add code to prevent duplicates as well. And enable/disable/hide/unhide whatever you need and under most conditions.

If you can hide the form, how is it you can't unhide it?
 
Thanks Burrina
Unfortunately, there are way too many variables that need to be checked to confirm whether a patient is a duplicate or not.


As for the hiding/unhiding conundrum.
When form A is opened, the detail section is hidden.
The user should search for a patient.
If the patient is not found, they click the 'Add New' but which opens Form B.
My problem comes after the user has updated form B and clicked 'Save'
My code should close form B and display the patient information without the user having to search for the patient they have just added.
 
I can't see what you are seeing so no real way to validate. Don't understand your validate process for sure. Without seeing some sort of demo I probably won't be much further help, sorry!
 

Users who are viewing this thread

Back
Top Bottom