[SOLVED] Problems with subforms and vba updates
Hello,
I have a problem with subforms and updating the parent recordsource with VBA.
I have 1 table with columns Article,DIM1,DIM2,FROM,TO,Discount
(I probably will get a lot of comments to make 2 tables... If i can't avoid it then i will change.)
So the "FROM" "TO" allows the user to enter multiple discounts.
Example :
Article1;color1;size1;0;50;3.5%
Article1;color1;size;50;100;3.5%
Article2;color1;size2;0;50;2.5%
Now i want to create the input field dynamic. So I already made a form where i select all the records with a given article,dim1 and dim2. Allowed the user to add new records or delete records in that table.
Now I try to make a sub-form where the user can select an article. This sub form has a query who group the articles from this table.
When they select an other article from the sub-form i want to update the parent form to display the correct records. (I do this now by populating 3 fields on the main form and then run a sub on that form.)
I managed already to do this. But sometimes, the sub-form is stuck in the update vba code. And i can't select an other article.
How can i achieve this without problems ?
(If something isn't clear, let me know. I can make a small database to show what i already have if needed)
Thanks,
Grumm
Hello,
I have a problem with subforms and updating the parent recordsource with VBA.
I have 1 table with columns Article,DIM1,DIM2,FROM,TO,Discount
(I probably will get a lot of comments to make 2 tables... If i can't avoid it then i will change.)
So the "FROM" "TO" allows the user to enter multiple discounts.
Example :
Article1;color1;size1;0;50;3.5%
Article1;color1;size;50;100;3.5%
Article2;color1;size2;0;50;2.5%
Now i want to create the input field dynamic. So I already made a form where i select all the records with a given article,dim1 and dim2. Allowed the user to add new records or delete records in that table.
Code:
"select * from discountTable where article='" & Me.Article.value & "' and DIM1='" & Me.DIM1 & "' and DIM2='" & Me.DIM2 & "'"
Now I try to make a sub-form where the user can select an article. This sub form has a query who group the articles from this table.
Code:
"select Article,DIM1,DIM2 from discountTable group by Article,DIM1,DIM2"
When they select an other article from the sub-form i want to update the parent form to display the correct records. (I do this now by populating 3 fields on the main form and then run a sub on that form.)
I managed already to do this. But sometimes, the sub-form is stuck in the update vba code. And i can't select an other article.
How can i achieve this without problems ?
(If something isn't clear, let me know. I can make a small database to show what i already have if needed)
Thanks,
Grumm
Last edited: