Changing field value in subform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dee

    Changing field value in subform

    I'm trying to change a field value on a subform called Inventory
    whenever a field on the main form is updated. I can't get it to work.
    Could someone correct my line of code?


    Private Sub Ctl5inBoxKDeliv _rd_AfterUpdate ()

    Me!Inventory.Fo rm.K5inBoxK = 99

    End Sub
  • Trevor Best

    #2
    Re: Changing field value in subform

    On 19 Nov 2003 23:24:10 -0800 in comp.databases. ms-access,
    wolfesimon@comc ast.net (Dee) wrote:
    [color=blue]
    >I'm trying to change a field value on a subform called Inventory
    >whenever a field on the main form is updated. I can't get it to work.
    >Could someone correct my line of code?
    >
    >
    >Private Sub Ctl5inBoxKDeliv _rd_AfterUpdate ()
    >
    >Me!Inventory.F orm.K5inBoxK = 99
    >
    >End Sub[/color]

    Me!Inventory.Fo rm!K5inBoxK = 99

    --
    A)bort, R)etry, I)nfluence with large hammer.

    Comment

    • Dee Simon

      #3
      Re: Changing field value in subform



      Me!Inventory.Fo rm!K5inBoxK = 99

      does not work either

      "Microsoft Access can't find the field 'Inventory' referred to in your
      expression."



      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Allen Browne

        #4
        Re: Changing field value in subform

        Dee, it is possible that the subform control does not have the same name as
        the form it contains (its SourceObject).

        Open your main form in Design view.
        Right-click the edge of the subform control, and choose Properties.
        Look at the Name property ("Other" tab) of the subform control.

        If' it's called "My Inventory" or something, try:
        Me![My Inventory].Form![K5inBoxK] = 99

        --
        Allen Browne - Microsoft MVP. Perth, Western Australia.
        Tips for Access users - http://allenbrowne.com/tips.html
        Reply to group, rather than allenbrowne at mvps dot org.

        "Dee Simon" <wolfesimon@com cast.net> wrote in message
        news:3fbc8511$0 $194$75868355@n ews.frii.net...[color=blue]
        >
        >
        > Me!Inventory.Fo rm!K5inBoxK = 99
        >
        > does not work either
        >
        > "Microsoft Access can't find the field 'Inventory' referred to in your
        > expression."[/color]


        Comment

        • Dee Simon

          #5
          Re: Changing field value in subform

          Thanks Allen

          That was it. Should have known this myself. Had a senior moment her
          after 36 hrs of no sleep.



          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Trevor Best

            #6
            Re: Changing field value in subform

            On 20 Nov 2003 13:50:39 GMT in comp.databases. ms-access, Dee Simon
            <wolfesimon@com cast.net> wrote:
            [color=blue]
            >Thanks Allen
            >
            >That was it. Should have known this myself. Had a senior moment her
            >after 36 hrs of no sleep.[/color]

            Nah, sleep is for wusses :-)

            --
            A)bort, R)etry, I)nfluence with large hammer.

            Comment

            Working...