Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieve default value on main form from subform 1

Status
Not open for further replies.

beansmom

Programmer
Aug 24, 2004
35
US
I have a main form with a continuous subform on it. I need to pull the value from a control on the main form and use it as a default value in a control on the subform.

Thanks for any help.
 
Please excuse my ignorance. I am new at this. Where would I put this line of code? Under an event? Under the default value of the control on the subform?

Thanks.
 
You need to put it in a suitable event which will 'fire' at a time to do waht you want it to do

I would suggest, without knowing exactly what you are doing it a suitable event may be in the before insert event of the sub form, or maybe the oncurrent event

if you are new to Access/VBA it is perhaps worth mentioning that it is also possible to refrence subform controls from the main form, this is achieved with syntax like so:

Me.MySubFormCONTROLName.Form.MyControlName[.property]


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top