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

    Form/SubForm Stuff (Access 2003)

    Once more have I seemingly created a piece of incestuous code.

    The following code
    Cheers,
    Andy

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

    Re: Form/SubForm Stuff (Access 2003)

    Would this work?

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    With Forms![frm 15 Inventory Master]
    Me!Inv_Adjust_QOH_Before = !txtOnHand
    ' Do "Stuff" here
    ...
    !txtOnHand = Me!Inv_Adjust_QOH_After
    End With
    End Sub

    (Not having the slightest idea of what you mean by do "Stuff" and when you do it doesn't help, of course)

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

    Re: Form/SubForm Stuff (Access 2003)

    Hans,

    My apologies for the "minimilist" note. I was on the way out the door from one site to the next, so I thought I'd try the condensed version. Your solution based on almost no information unfortunately gave me the results I deserved. It came back with the line highlighted and the message "You can't assign a value to this object." So, that being said and/or typed if you wish, I'll now settle down and get back to you with all the details about the "Stuff".

    Cheers, and thanks for your patience,
    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: Form/SubForm Stuff (Access 2003)

    OK, me back with a hopefully more coherent explanation of what it is I'm attempting to do. I should know better than trying to be minimalist.

    It's an Inventory System

    Main Form [frm 15 Inventory Master]

    It contains a text field called [txtOnHand] which holds the current calculated Quantity On Hand

    The Inventory Master File has a field called [WB_QOH] which is written back to after every transaction

    There are currently 3 subforms:

    Receipts [frm 15 Inv - 01
    Cheers,
    Andy

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

    Re: Form/SubForm Stuff (Access 2003)

    1) Wouldn't

    [Inv_Adjust_Qty]-[Inv_Adjust_QOH_Before]

    be simpler than

    ([Inv_Adjust_QOH_Before]-[Inv_Adjust_Qty])*-1

    2) Isn't NewQOH the same as Inv_Adjust_Qty ?

    3) It's not clear from your description where Inv_Adjust_QOH_After comes into this. You mention NewQOH, but don't tell us anything about Inv_Adjust_QOH_After.

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

    Re: Form/SubForm Stuff (Access 2003)

    Hans,

    Here's hoping I can clarify this a bit:

    1) Wouldn't
    Cheers,
    Andy

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

    Re: Form/SubForm Stuff (Access 2003)

    I hope that someone else can help. All this inventory stuff is beyond me. Sorry.

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

    Re: Form/SubForm Stuff (Access 2003)

    Hans,

    Thanks for taking the time for looking at this problem.

    If someone else is looking in, ignore everything about inventory and think only in terms of writing a single field from the main form to the subform, do a calculation using that field and then sending it back up to the main form.

    This always looks easy in writing.

    Thanks again and Cheers,

    Just me back to add a small note:

    I obviously couldn't see the forest for the programmers.

    Instead of "writing back" the new QOH to the Main Form, I've sent back the calculated difference and then included it in the calculation for the existing QOH on the Main Form.

    Duh!
    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
  •