Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2013
    Posts
    2

    Unanswered: Autofill TextBox in From based on a text field in a subform

    Hi all,

    I was hoping someone could help me with a problem I'm trying to figure out in Access.

    So, I have a overall master form which inside has sub forms.
    There is a subform (sfrmAgency) on the top left which is based on a query that is displaying an "Agency ID" which is based off an entered value right above it which is "Submission ID". I have the "Submission ID" in the sub form hidden, so you can only see the "Agency ID". The query is based on a table called "Submit".

    The "Agency ID" that I am trying to autofill is not within a subform, but rather it is in the main form and the source of the form is from a table called "Payment". I am trying to get it so that when the "Agency ID" from sfrmAgency is populated so is the "Agency ID" in the main form.

    I have tried to add the following code to the event, but it doesn't seem to be doing anything:

    Private Sub Agency_ID_Change()
    Me!Agency_ID.Text = Me!sfrmAgency!AgeAgency_ID.Text
    End Sub

    Any help would be greatly appreciated

  2. #2
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Try
    Me!Agency_ID=[Forms]![name of your main form]![sfrmAgency]![AgeAgency_ID]

  3. #3
    Join Date
    Nov 2013
    Posts
    2
    Quote Originally Posted by Poppa Smurf View Post
    Try
    Me!Agency_ID=[Forms]![name of your main form]![sfrmAgency]![AgeAgency_ID]
    I tried that and, but I am getting an error stating "Microsoft Access can't find the field 'Agency_ID' referred to in your expression.
    The following is my code:

    Me!Agency_ID = [Forms]![frmPayment]![sfrmAgency]![Agency_ID]

    I know that all my names are correct, could it be that there are two "Agency_ID"?

    -Thanks!

Posting Permissions

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