Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inventory Data Capture (Access 2003)

    Inventory situation, once more.

    When an item has been Issued from Stock using a subform (frm 15 Inventory - 02
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Inventory Data Capture (Access 2003)

    If you want to modify a value in the subform itself, you should use the Before Update event instead of the After Update event. Does the following do what you want?
    <code>
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    With Forms![frm 15 Inventory]
    .Recalc
    ![WB_QOH] = ![txtOnHand]
    Me!Inv_Issued_QOH = !txtOnHand
    End With
    End Sub</code>

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inventory Data Capture (Access 2003)

    Gee Hans,

    You are slowing down. That took 8 minutes for a reply. You probably went for a coffee. Anyway, give me a few minutes ( probably more than 8 ) and I'll let you know.

    Cheers,
    Cheers,
    Andy

  4. #4
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inventory Data Capture (Access 2003)

    Interesting Situation.

    When I used your suggested code:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    With Forms![frm 15 Inventory]
    .Recalc
    ![WB_QOH] = ![txtOnHand]
    Me!Inv_Issued_QOH = !txtOnHand
    End With
    End Sub

    I got a Runtime Error: 2115

    The macro of function set to the BeforeUpdate or Validation Rule property for this field is preventing SRT Systems from saving the data in the field.

    I clicked on Debug, and it highlighted .Recalc .

    So, I then tried:

    Private Sub Form_AfterUpdate()
    With Forms![frm 15 Inventory]
    .Recalc
    ![WB_QOH] = ![txtOnHand]
    Me!Inv_Issued_QOH = !txtOnHand
    End With
    End Sub

    I then got the old, You Can
    Cheers,
    Andy

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Inventory Data Capture (Access 2003)

    I don't know a way out of this vicious circle. I assume that the main form must be updated with a value depending on the subform, and you want the subform to be updated with a value from the main form. This causes a conflict.

  6. #6
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inventory Data Capture (Access 2003)

    Hans,

    Story of my life - vicious circle. Truth be known, the ability to do this would have been really nice, and icing on an Inventory cake, but not a life and death situation. I do appreciate your taking the time to look at this,

    Cheers,
    Cheers,
    Andy

  7. #7
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inventory Data Capture (Access 2003)

    Hans,

    Someday, the programming gods are going to get me for this, but, here
    Cheers,
    Andy

Posting Permissions

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