Main form - popup refresh

fabrizio19

Registered User.
Local time
Today, 15:46
Joined
Aug 9, 2012
Messages
75
Hi
I have the following problem:
From the form named Recovery I open by an on the event click a second form named vital signs (popup form).
In the popup form there are same variables such as heart rete and mean pressure that you can fill in it. I would like that when you close this popup form the value of heart rate and mean pressure are reproted updated in the Recovery form.
HELP ME!
 
In the On Close event of the popup form use

Forms!Recovery.Requery
 
Dear Bob,
I have tried it but it doesn't fix the problem.In fact the close event seems not trigger thr current event on the recovery form.Is there any other approach?
Many thanks f
 
Last edited:
Dear Bob,
I have tried it but it doesn't fix the problem.In fact the close event seems not trigger thr current event on the recovery form.Is there any other approach?
Many thanks f

Who said anything about the CURRENT event? I certainly didn't. I said, the close event of the popup form the code to requery the Recovery form. If the code is not firing, put a breakpoint on the close event of the popup form and then close it. The code should break there. If it doesn't, you may not have code enabled.

See here for how to set a breakpoint

See here for how to enable code (if in 2007) (if in 2010)
 
Dear Bob,
nothing happens!I try to explain myself better:


if I make alterations in the popup Form (vital signs), and then close it and the Recovery, and then open again Recovery, the alterations I make in the popup Form are reflected in the Recovery

Yours
f:banghead:
 
Last edited:
Sounds like the code is not running. Can you post a copy of the database using fake data so we can look?
 
Did you try Bob's code in the Form_Close event of the Vital Signs, popup Form?

Code:
Private Sub Form_Close()
 Forms!Recovery.Requery
End Sub
Linq ;0)>
 
Thank you so much!
I have attached a light version of the database.
There are several forms to pass before to get the target!
The two forms involved into the prblem are ;recovery and parametri vitali (in english vital signs)
Thanks again
f
 

Attachments

Okay, I'm not sure exactly what is supposed to happen, what should happen on Recovery when Parametri vitali is closed. What do you expect to happen?
 
As you can see HR(Fc in italian) and MAP came from the table parametri vitali by the DLOOKUP function.
When you open the Parametri vitali form from the recovery form and you fill in this the HR and MAP in two different moment [at the admission(time 0) and at the discharge (time 4) ---Combobox Timing] and then you close the parametri vitali form, I would like that the HR and the MAP would be reported in the recovery form straight away.
Now It happens only if I colse and open the recovery form after updating the parametri vitali form
 
As you can see HR(Fc in italian) and MAP came from the table parametri vitali by the DLOOKUP function.
When you open the Parametri vitali form from the recovery form and you fill in this the HR and MAP in two different moment [at the admission(time 0) and at the discharge (time 4) ---Combobox Timing] and then you close the parametri vitali form, I would like that the HR and the MAP would be reported in the recovery form straight away.
Now It happens only if I colse and open the recovery form after updating the parametri vitali form
The problem is that you have your Dlookups in the FORM LOAD event. So, if you wanted the data to show up again, you would either need to make the control's control source a DLookup or create a function in your form's module to do all of the DLookups and then call it from both your Load event and from your other form (if you make it public).

But looking at this, I fear that it is quite the mess and you are going through a lot of stuff just to do things which could be done much easier if you went down a different path.
 
Thank u for your reply.Which approach should i use to do it instead of dlookup?
f
 
Thank u for your reply.Which approach should i use to do it instead of dlookup?
f

I'm not completely sure how your whole process is supposed to work but I probably would use subforms which then can have a query as its record source. You can format a subform to not look like a subform.
 
any example to send to me?
I think I'm not able to do it!
thanks
f
 
any example to send to me?
I think I'm not able to do it!
thanks
f
Okay, take a look at how I modified the On Load event, created a function in the form's module named RunDLookups and then how I called it from the close event of the popup.

Now, if nothing happens, it is likely because your DLookups are not returning data. I couldn't test all of that because you didn't include test data like it would have been good so I didn't have to guess about which is what.
 

Attachments

You are a genius!!!!
So thanks!!
It is exactly what I wanted to do.
Last question
Why should it be a public function?
Many thanks
 
Me![qry_date subform].Requery
Forms!frm_home![qry_date subform].Requery

I've used this code a few times with success to update querys etc
 

Users who are viewing this thread

Back
Top Bottom