Solved how to send data from subform to subform

wanmurat

New member
Local time
Today, 23:59
Joined
Nov 15, 2022
Messages
3
1669714075385.png
 
Last edited:
Problems are so much easier to solve when you use your words. Let's start with nomenclature.
Update = make modifications to an EXISTING record
Add/Insert = add a new record to a table.

You say update but I'm guessing that you mean add. REGARDLESS, when you reference the controls of a form from outside of that form, you are ALWAYS referencing the current record. Whatever that might be. So, your posted code would overlay the current record of the left side subform. If the record pointer has not been moved by clicking into the new record, then the current record would be the FIRST record in the recordset being displayed by the subform. It looks like your record selector is pointing to the new record but I can't tell because I don't see the asterisk.

Typically, when you use one subform to select items to add to another, you would run an append query and then .requery the updated subform. You would not use this type of automation code.

The pictures are lovely but they don't give us any information on what is going wrong.
 
The two subforms are based on queries, so they display table contents.
I would very seldom transfer data from one form to another, if only because that creates ugly mutual dependencies. Since forms display table contents, I would make sure that the form saves its changes to the table. With a bound form this is very easy. The second form only has to get the current data status with a requery.
 
It doesn't matter whether the forms are bound to tables or queries. the functionality is mostly interchangeable as long as the query is updateable.

If you create an append query, you should only include the table into which the data will be inserted.

I still don't know what your question is.
 

Users who are viewing this thread

Back
Top Bottom