Default value for subform text box

dark11984

Registered User.
Local time
Tomorrow, 04:02
Joined
Mar 3, 2008
Messages
129
Hi Guys,
I have a mainform and a datahseet subform.

Mainform = FrmProj_ProjectEntry
Subform = FrmProj_ProjectEntry_Sub1

On my mainform I have a text box (FrmProj_ProjectEntry.txtDueDt) where I enter an expected date.
On my subform I also have a textbox (FrmProj_ProjectEntry_Sub1.txtDueDt) for entering an expected date.

I would like the entered date on the mainform to become the default expected date on the subform for new records only. Once records are created the expected date can then be changed for each record.

How would I achieve this on an after update event on FrmProj_ProjectEntry.txtDueDt?

Thanks
 
Set the DefaultValue property of the TextBox control. To reference that control from the mainform, on the subform, use syntax like . . .
Code:
dim tb as textbox
set tb = Me.SubformControlName.Form.TargetTextboxControlName
tb.defaultvalue = [I]<some value>[/I]
 
Compile Error:
Method or data member not found
 
That error is in respect to some code somewhere.
 
Hi,

I think this is what you are after

in form FrmProj_ProjectEntry_Sub1 on event AfterUpdate for field txtDueDt

Code:
Private Sub txtDue_AfterUpdate()
     Me.txtDueDt.Value = Forms("Main_Form").txtDueDT.Value
End Sub

James
 

Users who are viewing this thread

Back
Top Bottom