default value in subform from main form

paulhenley

Registered User.
Local time
Today, 12:36
Joined
Apr 16, 2002
Messages
23
Please can anyone help?

I have a form (Sales Header) with a subform (sales items). It is possible to have 100+ sales items within an order, so to save input time I need to be able to add a value in the header form that will be the default value for a field in the subform for each new item added. The user will then have the option to accept this default value or enter a new one. If this is possible, I will need to use it on several fields. (The value in the sales header will be different for each order)
 
If the main form reflects the order, set the default value to read in a textbox on the main form. Then refer to this in the default value of the control in your subform ie
=Forms!MainFormName!NameOfControlHoldingDefVal
HTH
 
Fizzio,

I think I have already done what you state, ie = Forms![CTL]![ctlquoteno]

CTL is my main form and ctlquoteno is the value that I want to get to set a field in the sub form. When I save this under the default value of the control in my subform all appears to be OK, but when I run my main form in add mode I get an error from Access saying that it needs to rebuild/repair the database. Am I doing something wrong?
 
Give Forms![CTL]![ctlquoteno] a default value also. This may work.
 

Users who are viewing this thread

Back
Top Bottom