Solved Update a subform

zelarra821

Registered User.
Local time
Today, 18:36
Joined
Jan 14, 2019
Messages
860
Good Morning.

I am trying to update a subform by changing a value in a field of the main form.

What I do is, after updating the main form field, execute an UPDATE of the table in VBA, and I want it to update the summation.

I leave you the database. I have hidden everything but the two forms involved. In them, I have marked in red the two fields that need to be updated when changing the main field. I have also left the two tables visible. And in VBA I have put the code I am referring to at the top of the form code.

Let's see if someone can help me.

Thanks.
 

Attachments

I didn't download your database, but have come across a similiar situation in the past. I found a quick an easy solution was just to close and reopen the mainform after updating info.
There is probably a better solution though
 
what is the formula of Beneficio on the subform?
 
Have you seen the code? I have it in a query, from where I take the value to put it in the subform through an UPDATE.
 
If I update the subform by Me! FPresupuestosSubformulario.Form.Requery, just me updated once.
 
I have shown you the query where the formula is. But as I told you, with VBA I pass that value to the table
 

Attachments

  • Database.accdb
    Database.accdb
    2.4 MB · Views: 167
  • ScreenShot001.jpg
    ScreenShot001.jpg
    551.7 KB · Views: 157
  • ScreenShot002.jpg
    ScreenShot002.jpg
    313.9 KB · Views: 162
I've already made it work. You have changed the code, and that cannot be touched, because it is the one in the subform, not the one in the main form. If I leave it as you have put it, it changes all the values.

Be that as it may, thank you very much.
 
You only need to update the Beneficio field.
 

Users who are viewing this thread

Back
Top Bottom