I am creating a quote DB and to link the header to the sub form I have done it on the ProjectID then crested an event procedure that on enter to the ProjectID field in the sub form it copies the ProjectID from the header form so the code reads
Private Sub ProjectID_Enter()
Me.ProjectID = [Forms]![QHForm]![Project Number]
This does not error but only inputs the last 3 characters of the ProjectID so 1002518 only shows 518 in the sub form. Anyone know why this would happen?
I cannot reproduce the problem, it works here with:
Private Sub Text_ID_Enter()
Me.Text_ID.Value = Me.Parent.Text_SysCounter.Value
- Do you need to fill in the ProjectID control of the subform only on the Enter event or should this control always be filled from the contents of [Project Number] from the parent form?
- Is there any other binding or links between the subform and its parent?
- What's the ControlSource property of ProjectID (if any)?
- Dou you use formats in ProjectID or in [Project Number]?
- Do [Project Number] and ProjectID refer to fields, controls or both?
Though its not problematic, when you refer to a parent form from a subform you can use Me.Parent instead of Forms!<ParentName>. This is useful when you re-use a subform with several parents.