SetValue from SubForm to another Form

mazza

Registered User.
Local time
Today, 10:49
Joined
Feb 9, 2005
Messages
101
I have a main form FrmQuote that has 2 Subforms. The 2nd subform FrmCalculateQuote is based on a calculation query. In order to save a calculated value I have another Table/Form (FrmSCQuoteOverviewUpdate) that records the quote value calculated in the subform FrmCalculateQuote (text34)

The following forms are open FrmQuote FrmSCQuoteOverviewUpdate and subform FrmCalculatequote.

In the subform FrmCalculatequote I have created a button click event that should set the value of [tot contract cost] in FrmSCQuoteOverviewUpdate
to text34 in the subform

Forms!FrmSCquoteoverviewUpdate![tot contract cost] = forms!Frmcalculatequote![text34]

when runnng the code I get the error message "run time error 2450..can't find the form FrmCalculatequote.."

It seems that the problem is in calling the subform just forms!....

Can somebody please help me with the code to refer to a subform.. :confused:
 
check here to see the correct syntax for referencing between forms and subforms.

In order to save a calculated value I have another Table/Form [/quote}

Why are you saving calculated values ? .... you should not store them in your database.
 
In order to reference the subform you must also reference the parent form. Below is what you should be using:
Forms!ParentForm.SubForm!Form.FieldName

Forms!FrmSCquoteoverviewUpdate![tot contract cost] = Forms!FrmQuote.Frmcalculatequote!Form.[text34]
 

Users who are viewing this thread

Back
Top Bottom