Avatar of Michael Paravicini
Michael Paravicini
Flag for Chile

asked on 

Changing RecordSource at Mainform with a Subform creates different behaviour

I’m stuck. I have a Form/Subform frame with the specialty that I will use different pairs of tables depending on need. One pair is Quotes/QuotesDetails the other pair of tables are Reservations/ReservationDetails. I change the RecordSource at the Load event of the mainform. The two tables are linked via GRESID for both sets of tables. The QuotesDetails and ReservationsDetails have RESID as unique additional key. Now, in the case of adding a new record for the set Quotes/QuotesDetails it will generate the Quotes!Gresid and the QuotesDetails!Resid but NOT the QuotesDetails!Gresid. In the case of the other table set the following happens when adding a new record: Reservations!Gresid and ReservationsDetails!Gresid are correctly generated when changing the first control of the main form. However, the RESID is only generated once I change something in the subform which seems to me to be the correct behavior. Does anyone understand why the behavior is different with the quotes set of tables and why the QuotesDetails!Gresid IS NOT shown? When I step thru the code the sequence is absolutely identical! Sorry if it all sounds very confusing but I would tremendeously appreciate any help! Rg Michael
Microsoft Access

Avatar of undefined
Last Comment
Michael Paravicini

8/22/2022 - Mon