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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set default value to value on main form

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
GB
i have a form with 3 sub forms. I want the default value of the contractID on the sub forms to be the contractID on the main form. What is the correct syntax - I can't seem to get it to work
 
=[Forms]![frmContractDetails]![contractID] in the default value property of the subform
 
Have you considered setting the Link Child and Link Master Fields to ContractID? This will have the same effect.

If you want the change in default value to have an immediate effect, try:

Code:
Private Sub ContractID_AfterUpdate()
Me.[i][Subform Control Name][/i].Form.ContractID.DefaultValue = Me.ContractID
End Sub

Otherwise, setting the default value as you show seems to work for me, but not for the current record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top