Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009

    Unanswered: Odd Result on Event Procedure

    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]
    End Sub

    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?

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    I cannot reproduce the problem, it works here with:
    Private Sub Text_ID_Enter()
        Me.Text_ID.Value = Me.Parent.Text_SysCounter.Value  
    End Sub
    - 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.
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts