Set values in subform when opening main form

hansnyc

Registered User.
Local time
Today, 05:49
Joined
Apr 12, 2007
Messages
50
Hello,
I'd like to know how to set values to a subform when opening a main form
I have a quotation form called FQuotation with a subform on it.
This subform is the link between the products and quotation it is called SFProdQuote and has the fields: refproduct, quantity, quote and PQTotal.
Once I have filled the info on the main form i pick the products on the subform using a combo box on the refproduct field, input the quantity and give it a quote.
All this works fine it calculates quantity x quote = total.

My issue is I'd like to create a quotation form that opens with a set of products already selected in the subform. let say 10 of them, since my quotations always start with the same 10 products or so. I do not want the users to have to select over and over the same things.

Is it possible to open a form with set values selected in the combox of its subform?

Thanks for your help
 
You should be able to add the records you need to the query to which the subform is bound. Either use a RecordSet or a query to add the records.
 
That's assuming i'm a genius like you! ;)
The subform is link to a table. I tried do a query but doesnt return the set of records i want. I'm not familiar with recordset.
do you know a good exemple?
Thanks a lot

You should be able to add the records you need to the query to which the subform is bound. Either use a RecordSet or a query to add the records.
 
Without adding criteria, a query return a table *exactly* as it is so I don't know why you didn't get the records returned that you wanted. A query can do everything a table can do plus a lot more. There must be some examples of using recordsets in the code/database area of this forum.
 
Ok I have my form
called FQuotation with a subform on it called SFProdQuote from the table TProdQuote and has the fields: refproduct, quantity, quote and PQTotal.
The way it is set up my subform opens with blank fields and awaits user to pick products one by one on the combox refproduct.
I do not know how a query can help open the subform with already 3 lines of refproduct selected. which is what i'd like
can u help?

Without adding criteria, a query return a table *exactly* as it is so I don't know why you didn't get the records returned that you wanted. A query can do everything a table can do plus a lot more. There must be some examples of using recordsets in the code/database area of this forum.
 
You can add the proper records to the TProdQuote table from code in your MainForm. I hope the refproduct field is not a LookUp field.
 
No it's a text field in TProdQuote
How do I go about coding my main form to return the desired refproducts in the subform?
Thanks

You can add the proper records to the TProdQuote table from code in your MainForm. I hope the refproduct field is not a LookUp field.
 
Can you describe what records you need and would it be possible to post your db so we can code it. It is a little too complicated to try and describe it in a post.
 

Users who are viewing this thread

Back
Top Bottom