Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2006
    Location
    Mount Wolf, PA
    Posts
    21

    Question Unanswered: Main Form Sub Form

    When clicking in the txtID field on the sub form ‘frm_WorkEntry_Subform’ (the default view for the sub form is datasheet), I want the ID number to appear on the main form in a text box named ‘txtProbID’. When I click in any of the txtID rows, the following error is returned: "Microsoft Access can't find the form 'frm_WorkEntry_Subform' referred to in a macro expression or Visual Basic code." I have altered the code, but still receive various errors. How can I get the value from the subform to the main form?

    This is my code:
    On Error GoTo Err_txtID_Click

    [Forms]![frm_ScorecardInformationEntryForm]![txtProbID].[Value] = [Forms]![frm_WorkEntry_Subform]![txtID].[Value]

    Exit_txtID_Click:
    Exit Sub

    Err_txtID_Click:
    MsgBox Err.Description
    Resume Exit_txtID_Click

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    try

    [Forms]![frm_ScorecardInformationEntryForm]![txtProbID].[Value] = me.txtProbID

  3. #3
    Join Date
    Jan 2006
    Location
    Mount Wolf, PA
    Posts
    21
    I receive an error, "Object Required", when I use the following code:
    [Forms]![frm_ScorecardInformationEntryForm]![txtProbID].[Value] = Me.txtID

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try
    Forms!MainFormName!SubFormName!Form!TextBoxName= txtID

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Or
    Forms!MainFormName!SubFormName!Form.TextBoxName= txtID
    But I think the first is ok....

  6. #6
    Join Date
    Jan 2006
    Location
    Mount Wolf, PA
    Posts
    21
    hammbakka,

    This worked:
    Forms!frm_ScorecardInformationEntryForm!txtProbID = txtID

    Thank you for your help!
    em2525

Posting Permissions

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