0
votes

I have a list control on my form. The values of this list come from a query. the Row source of the List is like this:

SELECT tb_lable_Daten.name
FROM tb_lable_Daten;

and Control Source of the list is name I want if the user change the value of the List(with mouse, key down,...) the value of controls( 3 Texts) in Sub form changes too. The query in Sub form should be:

SELECT XValue, YValue, Wert
FROM tb_DCM_Daten
WHERE (tb_DCM_Daten.name)=name); // It is List value

I put this query on Subforms recordsource but that doesnt work.

Could you please tell me how can I do that?

1
Are you getting an error or are the values just not updating? It might need a .Requery() to pull in the new data. - Bmo
no errors but it would not be updated - Kaja
See if you can put a Subform.Requery() after you set the subform's recordsource. - Bmo

1 Answers

0
votes

I know I'm coming in three years late. However for anyone that comes here... The .Requery() is needed but the main issue is that for the Record Source for the field in the subform it should read =[FORMS]![MainForm]![ListField] where mainform = the name of the parent form and listfield = the name of the list field on the parent form. In addition having the .Requery() on update would push the new value to the subform.